在使用pandas将时间类型转换为DatetimeIndex后想通过weekday_name方法得到具体日期是星期几时报错
报错的提示是:AttributeError: ‘DatetimeIndex’ object has no attribute 'weekday_name’
解决方案1:回退pandas的版本,在cmd中输入:pip install --upgrade pandas==0.25.3,实测这种方法可以快速解决该问题
解决方案2:https://github.com/facebook/prophet/issues/1304
AttributeError: ‘DatetimeIndex‘ object has no attribute ‘weekday_name‘
最新推荐文章于 2024-05-31 17:13:43 发布
本文介绍了解决在使用pandas将时间类型转换为DatetimeIndex后调用weekday_name方法出现AttributeError的问题。提供了两种解决方案,一是回退pandas版本至0.25.3,二是提供了一个GitHub链接供进一步研究。

890





