1.Question
AttributeError: ‘DatetimeProperties’ object has no attribute ‘weekday_ name’
Simple test, run the following code:
import pandas as pd
# Create dates
dates = pd.Series(pd.date_range("7/26/2021", periods=3, freq="D"))
# Check the day of the week
print(dates.dt.weekday_name)
# Show only values
print(dates.dt.weekday)
2.Solution
weekday_ Change name to day_ name()
import pandas as pd
# Create dates
dates = pd.Series(pd.date_range("7/26/2021", periods=3, freq="D"))
# Check the day of the week
print(dates.dt.day_name())
# Show only values
print(dates.dt.weekday)
For example:
Type
Read More:
- [Solved] AttributeError: ‘DataFrame‘ object has no attribute ‘tolist‘
- [Solved] AttributeError: ‘PngImageFile‘ object has no attribute ‘imshow‘
- [Solved] AttributeError: ‘DataFrame‘ object has no attribute ‘map‘
- [Solved] AttributeError: ‘str‘ object has no attribute ‘decode‘
- [Solved] AttributeError: ‘DataParallel‘ object has no attribute ‘save‘
- [Solved] Networkx Error: Attributeerror: ‘graph’ object has no attribute ‘node’
- [Solved] AttributeError WriteOnlyWorksheet object has no attribute cell
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘append‘
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘astype‘
- [Solved] vpython: AttributeError: ‘box‘ object has no attribute ‘idx‘
- [Solved] AttributeError: ‘HTMLWriter‘ object has no attribute ‘_temp_names‘
- [Solved] AttributeError: ‘str‘ object has no attribute ‘decode‘
- [2021-10-05] Python Error: AttributeError: ‘NoneType‘ object has no attribute ‘append‘
- [Solved] AttributeError: DataFrame object has no attribute’xxx’
- [Solved] AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id‘
- [Solved] Pycharm error: attributeerror: ‘Htmlparser’ object has no attribute ‘unescape’
- [Solved] Paramiko error: AttributeError: ‘NoneType’ object has no attribute ‘time’
- How to Solve attributeerror: ‘list’ object has no attribute ‘shape‘
- [Modified] AttributeError: ‘socket‘ object has no attribute ‘ioctl‘ python linux
- [Solved] AttributeError: ‘_IncompatibleKeys’ object has no attribute