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
{{ message }}
Repository navigation
Decide how/if to have hooks for .imag/.real or general dtype specific attributes #13
The .imag and .real properties of ndarray return views into the original array. This means they cannot be described, e.g. by UFuncs. We could add an imag/real method/slot to the new DTypes which:
Returns the offset into the existing dtype
Returns a new dtype
With that information, the ndarray can return the new view.
We could allow dtypes to tag on more special attributes (think quaternions, etc.). But it seems dangerous, at least for now. However, another thing would be to do this through some special new attribute on ndarray, such as ndarray.elementwise.<method>(*args, **kwargs) calling special dtype.arr_methods.<method>(array, dtype, *args, *kwargs) or similar.
Activity
mattip commentedon Nov 21, 2019
Note that today
np.ones(100, dtype='uint8').imagdoes actually create a zero-ed arrayAdd 64 bit Windows builds [wheel build]