Skip to main content
`Ctrl`+`K`

# pandas.Series.dt.freq

Series.dt.freq

  Return a string representing a frequency generated by infer_freq.

  Deprecated since version 3.1.0: A future version of pandas will return a `BaseOffset` object (or `None`) instead of a string. Use `pd.set_option('future.infer_freq_returns_offset', True)` to opt in to the future behavior.

  Returns None if it can’t autodetect the frequency.

  See also

  `Series.dt.to_period`

    Cast to PeriodArray/PeriodIndex at a particular frequency.

  Examples

      >>> ser = pd.Series(["2024-01-01", "2024-01-02", "2024-01-03", "2024-01-04"])
      >>> ser = pd.to_datetime(ser)
      >>> ser.dt.freq
      'D'

      >>> ser = pd.Series(["2022-01-01", "2024-01-01", "2026-01-01", "2028-01-01"])
      >>> ser = pd.to_datetime(ser)
      >>> ser.dt.freq
      '2YS-JAN'