File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2395,17 +2395,18 @@ cdef class _Period(PeriodMixin):
2395
2395
def fast_strftime (self , fmt_str: str ) -> str:
2396
2396
"""A faster alternative to `strftime` using string formatting.
2397
2397
2398
- `fmt_str` should be created using `convert_period_format (fmt )`.
2398
+ `fmt_str` should be created using `convert_strftime_format (fmt )`.
2399
2399
2400
2400
See also `self.strftime`, that relies on `period_format`.
2401
2401
2402
2402
Examples
2403
2403
--------
2404
2404
2405
+ >>> from pandas._libs.tslibs import convert_strftime_format
2405
2406
>>> a = Period(freq = ' Q-JUL' , year = 2006 , quarter = 1 )
2406
2407
>>> a.strftime('%F-Q%q')
2407
2408
'2006-Q1'
2408
- >>> fast_fmt = convert_period_format (' %F -Q%q ' )
2409
+ >>> fast_fmt = convert_strftime_format (' %F -Q%q ' , target = " period " )
2409
2410
>>> a.fast_strftime(fast_fmt )
2410
2411
'2006-Q1'
2411
2412
"""
Original file line number Diff line number Diff line change @@ -1204,6 +1204,7 @@ class Timestamp(_Timestamp):
1204
1204
1205
1205
Examples
1206
1206
--------
1207
+ >>> from pandas._libs.tslibs import convert_strftime_format
1207
1208
>>> ts = pd.Timestamp(' 2020-03-14T15:32:52.192548651' )
1208
1209
>>> fmt = convert_strftime_format(' %Y -%m -%d %X ' )
1209
1210
>>> ts.fast_strftime(fmt )
You can’t perform that action at this time.
0 commit comments