FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Masked array view fails if structured dtype has datetime component · Issue #4476 · numpy/numpy · GitHub

/ numpy Public

Masked array view fails if structured dtype has datetime component #4476

Description

A view as numpy.ma.MaskedArray fails if the array has a structured dtype, including at least one part that is datetime64, as follows:

$ python3.3
Python 3.3.2+ (default, Feb 28 2014, 00:52:16) 
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import numpy, numpy.ma, numpy.version
>>> numpy.version.version
'1.8.0'
>>> A = numpy.empty(shape=(5,), dtype=[("A", "<f4"), ("B", "datetime64[ms]")])
>>> A.view(numpy.ma.MaskedArray)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/gerrit/venv/python-3.3/lib/python3.3/site-packages/numpy/ma/core.py", line 2800, in __array_finalize__
    self._fill_value = _check_fill_value(None, self.dtype)
  File "/home/gerrit/venv/python-3.3/lib/python3.3/site-packages/numpy/ma/core.py", line 402, in _check_fill_value
    dtype=ndtype,)
ValueError: Error parsing datetime string "?" at position 0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL