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
Currently the date and time components on a DatetimeIndex return a numpy array. I would propose to let them return a new Index object (and in this way retaining all the interesting added functionality of an Index object).
Related to #14506 that changed Index.map to return an Index instead of an array.
… (GH15022)
closespandas-dev#15022
Author: Joris Van den Bossche <[email protected]>
Closespandas-dev#15589 from jorisvandenbossche/api-dt-fields-index and squashes the following commits:
ffacd38 [Joris Van den Bossche] doc fixes
41728a9 [Joris Van den Bossche] FIX: boolean fields should still return array
6317b6b [Joris Van den Bossche] Add whatsnew
96ed069 [Joris Van den Bossche] Preserve name for PeriodIndex field accessors
cdf6cae [Joris Van den Bossche] Preserve name for DatetimeIndex field accessors
f2831e2 [Joris Van den Bossche] Update timedelta accessors
52f9008 [Joris Van den Bossche] Fix tests
41008c7 [Joris Van den Bossche] API: return Index instead of array from datetime field accessors (GH15022)
Problem description
Currently the date and time components on a DatetimeIndex return a numpy array. I would propose to let them return a new Index object (and in this way retaining all the interesting added functionality of an Index object).
Related to #14506 that changed
Index.map
to return an Index instead of an array.Code Sample
When the above would return an index, something that would become possible is this:
which is now not possible as an array has no isin method.
Using pandas master, 0.19.0+289.g1bf94c8
The text was updated successfully, but these errors were encountered: