-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fixed Period
and PeriodIndex
formatting
#46361
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
Fixed Period
and PeriodIndex
formatting
#46361
Conversation
…aintenance. Added a `TestPeriodIndexFormat` class
…atetimeIndex.strftime`. Added a specific mention about %r and %R directives
Formats supported by the C `strftime` API but not by the python string format | ||
doc (such as `"%%R"`, `"%%r"`) are not officially supported and should be | ||
preferably replaced with their supported equivalents (such as `"%%H:%%M"`, | ||
`"%%I:%%M:%%S %%p"`). |
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 clarification comes from the fact that on one side we refer to python strftime doc (just above this text), while in the example (line 1623 below) the %r
directive is used !
I checked: neither %r or %R are in the official python doc for strftime, and they are not as well in the extended directives that we support in Period.strftime. But... they work. So this needs explicit clarification I think.
The error in CI seems related to usage of |
Ready for review @jreback @mroeschke . |
Thanks @jbrockmendel and @mroeschke for the review ! |
All set (thanks @mroeschke for resolving the last comment). |
Could you merge main in one more time just to be sure? |
…ure/46252_period_formatting
thanks @smarie very nice! |
Thank you all for the quick review ! |
PeriodIndex.strftime
andPeriod.strftime
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Note: this is the first PR extracted from #46116. More to come soon :)