AttributeError: 'DatetimeProperties' object has no attribute 'week'
时间: 2023-10-06 08:07:14 浏览: 600
这个错误是因为'DatetimeProperties'对象没有'week'属性。为了解决这个问题,你可以将'weekday_name'改为'day_name()'。你可以使用pandas库来处理日期。首先,导入pandas库并创建一个日期序列。然后,使用'dates.dt.day_name()'来查看每个日期对应的星期几。如果只想显示数值,可以使用'dates.dt.weekday'。这样就可以避免出现'AttributeError: 'DatetimeProperties' object has no attribute 'week''的错误了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [AttributeError: ‘DatetimeProperties’ object has no attribute ‘weekday_name’ 的解决方法](https://blog.csdn.net/fyfugoyfa/article/details/119090111)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [# Pycharm关于AttributeError: ‘DataFrame’ object has no attribute ‘score’的错误](https://download.csdn.net/download/weixin_38720756/13749766)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文