rom_ordinals.html)
  * [ Date offsets ](../offset_frequency.html)
  * [ Window ](../window.html)
  * [ GroupBy ](../groupby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * __
  * [ pandas.PeriodIndex ](pandas.PeriodIndex.html)
  * pandas.Perio... 

#  pandas.PeriodIndex.strftime  #

PeriodIndex.  strftime  (  _ *  args  _ , _ **  kwargs  _ )  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/indexes/extension.py#L92-L102) #

    

Convert to Index using specified date_format.

Return an Index of formatted strings specified by date_format, which supports
the same string format as the python standard library. Details of the string
format can be found in [ python string format doc
](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-
behavior) .

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â  ).

Note that  PeriodIndex  support additional directives, detailed in
Period.strftime  .

Parameters  :

    

**date_format** str

    

Date format string (e.g. â%Y-%m-%dâ).

Returns  :

    

ndarray[object]

    

NumPy ndarray of formatted strings.

See also

[ ` to_datetime  ` ](pandas.to_datetime.html#pandas.to_datetime
"pandas.to_datetime")

    

Convert the given argument to datetime.

[ ` DatetimeIndex.normalize  `
](pandas.DatetimeIndex.normalize.html#pandas.DatetimeIndex.normalize
"pandas.DatetimeIndex.normalize")

    

Return DatetimeIndex with times to midnight.

[ ` DatetimeIndex.round  `
](pandas.DatetimeIndex.round.html#pandas.DatetimeIndex.round
"pandas.DatetimeIndex.round")

    

Round the DatetimeIndex to the specified freq.

[ ` DatetimeIndex.floor  `
](pandas.DatetimeIndex.floor.html#pandas.DatetimeIndex.floor
"pandas.DatetimeIndex.floor")

    

Floor the DatetimeIndex to the specified freq.

[ ` Timestamp.strftime  `
](pandas.Timestamp.strftime.html#pandas.Timestamp.strftime
"pandas.Timestamp.strftime")

    

Format a single Timestamp.

[ ` Period.strftime  ` ](pandas.Period.strftime.html#pandas.Period.strftime
"pandas.Period.strftime")

    

Format a single Period.

Examples

    
    
    >>> rng = pd.date_range(pd.Timestamp("2018-03-10 09:00"),
    ...                     periods=3, freq='s')
    >>> rng.strftime('%B %d, %Y, %r')
    Index(['March 10, 2018, 09:00:00 AM', 'March 10, 2018, 09:00:01 AM',
           'March 10, 2018, 09:00:02 AM'],
          dtype='object')
    

[ __ previous  pandas.PeriodIndex.asfreq  ](pandas.PeriodIndex.asfreq.html
"previous page") [ next  pandas.PeriodIndex.to_timestamp  __
](pandas.PeriodIndex.to_timestamp.html "next page")

__ On this page

  * ` PeriodIndex.strftime()  `

[ __ Show Source
](../../_sources/reference/api/pandas.PeriodIndex.strftime.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.