-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: remove datetime-like index ops from Series #7206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
API: remove datetime-like index ops from Series
- allow ``Series`` and ``Index`` to share common ops. remove the ``Series.weekday`` property from Series; | ||
Using a ``DatetimeIndex/PeriodIndex`` method on a Series will now raise a ``TypeError``. | ||
support ``min(),max(),factorize(),unique(),nunique(),value_counts()`` on ``Index`` types. | ||
(:issue:`4551`, :issue:`4056`, :issue:`5519`, :issue:`6380`, :issue:`7206`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit cryptic I think. On the one hand you say that Series and Index share common operators, but then you say weekday is removed and datetimeindex methods on a series will raise (so this is not sharing).
Are the changes that are relevant to users not:
- Series.weekday is removed (and actually should first be deprecated?)
- min/max/unique/nunique/value_counts methods are added to Index types (that they are shared with Series is an implementation detail, no?)
Just added a note about the new whatsnew entry, but for the rest am OK on disabling this for now. |
@jorisvandenbossche fair comments the issue is that it can become ambiguous, so don't want to add something w/o dealing with that. Series.weekday wasn't documented at all so I don't think a big deal to remove. |
@jreback OK for the weekday What do you mean with ambiguous? What can become ambiguous? |
not the usage of
|
ah yes OK, |
no, the others were added (not in this PR necessarily, though max/min were), but don't think had any notes on them |
What was actually added? (I just realize I don't fully understand this) For example |
all of these were added as mixin methods that is they were moved from index/series directly to the ops mixin class (so max.min) were not added to index but the other were added to index |
There still some occurences in the docs (that now error): http://pandas-docs.github.io/pandas-docs-travis/timeseries.html#custom-business-days-experimental |
as per discussed in #7146. may provide a
to_index()
and/or an accessor in future versions