You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usually one can select a subset of fields from a structured array using rarray[list_of_fields]. If the structured array contains objects (dtype O) -- even if an object field isn't being selected -- an error is thrown (in numpy 1.7.1).
This field-slice process functions by creating a view with a modified dtype; for this example, the new dtype is: {'names': ['a', 'b'], 'formats': [dtype('float32'), dtype('float32')], 'offsets': [0, 4], 'itemsize': 74}.
It seems the checks in array_descr_set are too conservative, discarding alternative views of any array including objects. While it is understandable that this check ensures against arbitrary modification of memory, it makes structured arrays containing objects very unwieldy.
Surely this validation can be made more precise, or else disabled for particular safe operations.
Activity
ENH: structured datatype safety checks
ENH: structured datatype safety checks
ENH: structured datatype safety checks
ENH: structured datatype safety checks
ENH: structured datatype safety checks
ENH: structured datatype safety checks
ENH: structured datatype safety checks
ENH: structured datatype safety checks
ENH: structured datatype safety checks
ENH: structured datatype safety checks