Skip to main content
`Ctrl`+`K`

# pandas.DatetimeIndex.inferred_freq

DatetimeIndex.inferred_freq

  Return the inferred frequency of the index.

  Returns:
    str or None

      A string representing a frequency generated by `infer_freq`. Returns `None` if the frequency cannot be inferred.

  See also

  `DatetimeIndex.freqstr`

    Return the frequency object as a string if it’s set, otherwise `None`.

  Examples

  For `DatetimeIndex`:

      >>> idx = pd.DatetimeIndex(["2018-01-01", "2018-01-03", "2018-01-05"])
      >>> idx.inferred_freq
      '2D'

  For `TimedeltaIndex`:

      >>> tdelta_idx = pd.to_timedelta(["0 days", "10 days", "20 days"])
      >>> tdelta_idx
      TimedeltaIndex(['0 days', '10 days', '20 days'],
                     dtype='timedelta64[us]', freq=None)
      >>> tdelta_idx.inferred_freq
      '10D'