相关疑难解决方法(0)

AttributeError:“ time.struct_time”对象没有属性“ toordinal”

我是python新手,我无法理解如何正确格式化日期。

我的数据是这样的 Fri, 09 Dec 2011 06:50:37 UTC

我正在这样准备:

dates.append(time.strptime(row[5], "%a, %d %b %Y %H:%M:%S %Z"))
Run Code Online (Sandbox Code Playgroud)

然后我正在尝试使用它

dates = matplotlib.dates.date2num(dates)
Run Code Online (Sandbox Code Playgroud)

得到以下错误:

AttributeError: 'time.struct_time' object has no attribute 'toordinal'
Run Code Online (Sandbox Code Playgroud)

python matplotlib

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

matplotlib ×1

python ×1