pandas.DatetimeIndex.freqstr
- propertyDatetimeIndex.freqstr[source]
-
Возвращает строковое представление объекта частоты, если он задан, иначе None.
Примеры
Для DatetimeIndex:
>>> idx = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00"], freq="D") >>> idx.freqstr 'D'
Частота может быть определена, если есть более 2 точек:
>>> idx = pd.DatetimeIndex(["2018-01-01", "2018-01-03", "2018-01-05"], ... freq="infer") >>> idx.freqstr '2D'
Для PeriodIndex:
>>> idx = pd.PeriodIndex(["2023-1", "2023-2", "2023-3"], freq="M") >>> idx.freqstr 'M'
© 2008–2022, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.2.2/reference/api/pandas.DatetimeIndex.freqstr.html