Thanks to visit codestin.com
Credit goes to github.com

Skip to content

viewing an array with a fieldless structured dtype does not update the dtype: #14344

@ahaldane

Description

@ahaldane

As discovered in #14310 , viewing an array with a fieldless structured dtype does not update the dtype/itemsize:

>>> a = np.zeros(2, dtype={'names':[], 'formats':[], 'offsets':[], 'itemsize':8})
>>> b = a.view(np.dtype([]))
>>> b
array([], shape=(2, 0),
      dtype={'names':[], 'formats':[], 'offsets':[], 'itemsize':8})
>>> b.dtype == np.dtype([])
False

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