Description
Related to #18262, but since this is a very specific class of attributes, thought to open a specific issue about it.
We have a bunch of attributes on the Series
class that stem from the time it was a numpy array subclass, and now just pass through the attribute of the underlying numpy array. It are typically attributes describing the data layout specific to the numpy array, which I don't think necessarily makes sense for a Series:
Series.base
Series.data
Series.strides
Series.itemsize
Series.flags
and potentially also:
Series.real
andSeries.imag
So deprecating those can potentially remove 7 entries from the Series namespace.
Are there good reasons to keep them? Is this somehow useful for "compatibility" (writing code that works for both series as numpy array)
(I personally can't think of a usecase where you would want one of the above, unless you explicitly know will deal with numpy arrays)
One of the problems might be that if we refer users to Series.values.<attribute>
that this will depend on the underlying array type if that will work or not (eg if .values
starts giving an ExtensionArray, it will also not have those attributes)
cc @shoyer I don't think you kept those for "compatibility" in DataArray in xarray?
And in dask I think itemsize
, real
and imag
is provided.