pandas.DatetimeIndex.freq#
- property DatetimeIndex.freq[source]#
Return the frequency object if it is set, otherwise None.
To learn more about the frequency strings, please see this link.
See also
DatetimeIndex.freqReturn the frequency object if it is set, otherwise None.
PeriodIndex.freqReturn 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[ns, America/Chicago]', freq='h') >>> datetimeindex.freq <Hour>