-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
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
Changes from 11 commits
3cc7fac
b5085fe
6460a4f
ace7648
98daeb2
8299492
8378c8a
e05fa01
d3c319b
7b9c52e
bfbe094
46e9f67
fc64654
d91e12c
df8d6e1
6eecc1b
0d75f76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1589,6 +1589,14 @@ def strftime(self, date_format: str) -> npt.NDArray[np.object_]: | |
of the string format can be found in `python string format | ||
doc <%(URL)s>`__. | ||
|
||
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"`). | ||
Comment on lines
+1596
to
+1599
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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. |
||
|
||
Note that `PeriodIndex` support additional directives, detailed in | ||
`Period.strftime`. | ||
|
||
Parameters | ||
---------- | ||
date_format : str | ||
|
@@ -1605,6 +1613,8 @@ def strftime(self, date_format: str) -> npt.NDArray[np.object_]: | |
DatetimeIndex.normalize : Return DatetimeIndex with times to midnight. | ||
DatetimeIndex.round : Round the DatetimeIndex to the specified freq. | ||
DatetimeIndex.floor : Floor the DatetimeIndex to the specified freq. | ||
Timestamp.strftime : Format a single Timestamp. | ||
Period.strftime : Format a single Period. | ||
|
||
Examples | ||
-------- | ||
|
Uh oh!
There was an error while loading. Please reload this page.