Python 确定偏移量是否为固定偏移量

Python 确定偏移量是否为固定偏移量,python,pandas,Python,Pandas,有没有办法确定熊猫的偏移量是否固定?目前,我正在尝试获取nanos属性,这将为非固定偏移量引发ValueError 将熊猫作为pd导入 pd.offsets.MonthBegin().nanos 提高 Traceback (most recent call last): File "<input>", line 1, in <module> File "pandas/_libs/tslibs/offsets.pyx", l

有没有办法确定熊猫的偏移量是否固定?目前,我正在尝试获取
nanos
属性,这将为非固定偏移量引发
ValueError

将熊猫作为pd导入
pd.offsets.MonthBegin().nanos
提高

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "pandas/_libs/tslibs/offsets.pyx", line 684, in pandas._libs.tslibs.offsets.BaseOffset.nanos.__get__
ValueError: <MonthBegin> is a non-fixed frequency
但这感觉就像我在依赖一个实现细节。我找不到类似的内置方法。我忽略了什么吗