-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: Return Index from DatetimeIndex/PeriodIndex.strftime #20240
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
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.
lgtm.
doc/source/whatsnew/v0.23.0.txt
Outdated
@@ -711,6 +711,7 @@ Other API Changes | |||
- ``Categorical.fillna`` now validates its ``value`` and ``method`` keyword arguments. It now raises when both or none are specified, matching the behavior of :meth:`Series.fillna` (:issue:`19682`) | |||
- ``pd.to_datetime('today')`` now returns a datetime, consistent with ``pd.Timestamp('today')``; previously ``pd.to_datetime('today')`` returned a ``.normalized()`` datetime (:issue:`19935`) | |||
- :func:`Series.str.replace` now takes an optional `regex` keyword which, when set to ``False``, uses literal string replacement rather than regex replacement (:issue:`16808`) | |||
- ``DatetimeIndex.strftime`` and ``PeriodIndex.strftime`` now return an ``Index`` instead of a numpy array to be consistent with similar accessors (:issue:`20127`) |
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.
can you add the :func: ref here
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.
in theory you should have to change some tests on Series.dt.strftime
, if you don't that means we are not fully testing this, can you check.
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.
But how would the output of Series.dt.strftime
change when DatetimeIndex.strftime
returns an Index
instead of an array? It doesn't seem to ultimately affect anything in Series.dt.strftime
from what I can tell.
@reidy-p merged the pre-cursor, can you rebase |
Codecov Report
@@ Coverage Diff @@
## master #20240 +/- ##
==========================================
- Coverage 91.77% 91.76% -0.02%
==========================================
Files 152 150 -2
Lines 49196 49151 -45
==========================================
- Hits 45151 45102 -49
- Misses 4045 4049 +4
Continue to review full report at Codecov.
|
thanks @reidy-p keep em coming! |
git diff upstream/master -u -- "*.py" | flake8 --diff
I will update the docstring after #20103 is merged.