Skip to main content
`Ctrl`+`K`

# pandas.DatetimeIndex.freq

property DatetimeIndex.freq

  Return the frequency object if it is set, otherwise None.

  To learn more about the frequency strings, please see this link.

  See also

  `DatetimeIndex.freq`

    Return the frequency object if it is set, otherwise None.

  `PeriodIndex.freq`

    Return the frequency object if it is set, otherwise None.

  Examples

      >>> datetimeindex = pd.date_range(
      ...     "2022-02-22 02:22:22", periods=10, tz="America/Chicago", freq="h"
      ... )
      >>> datetimeindex
      DatetimeIndex(['2022-02-22 02:22:22-06:00', '2022-02-22 03:22:22-06:00',
                     '2022-02-22 04:22:22-06:00', '2022-02-22 05:22:22-06:00',
                     '2022-02-22 06:22:22-06:00', '2022-02-22 07:22:22-06:00',
                     '2022-02-22 08:22:22-06:00', '2022-02-22 09:22:22-06:00',
                     '2022-02-22 10:22:22-06:00', '2022-02-22 11:22:22-06:00'],
                    dtype='datetime64[us, America/Chicago]', freq='h')
      >>> datetimeindex.freq
      <Hour>