我有两个日期start_date
和end_date
,稍后将在pandas.date_range()
中使用。
start_date = datetime.datetime(2014, 2, 8, 0, 0, tzinfo=rfc3339.UTC_TZ)
end_date = datetime.datetime(2016, 1, 29, 0, 0, tzinfo=rfc3339.UTC_TZ)
pd.date_range(start_date, end_date)
这两个日期都有偏移量,当我在pd.date_range()
中使用它们时,会不断出现类似以下错误:
AttributeError: 'str' object has no attribute 'offset'
Exception AttributeError: "'str' object has no attribute 'offset'" in 'pandas._libs.tslibs.conversion.tz_convert_single' ignored
*** AttributeError: 'UTC' object has no attribute 'offset'
有人可以帮助我如何转换这些日期,以便可以在pd.data_range()
中使用它们吗?