solve the problem
return object.__getattribute__(self, name)
AttributeError: ‘DataFrame’ object has no attribute ‘tolist’
Solution ideas
Property error: ‘dataframe’ object does not have property ‘tolist’
Solution:
Remember that DataFrame does not have a tolist() method, but series.Series has a tolist() method, so it needs to be modified
take
import pandas as pd
#Read xls file
file_path='data/test1226.xls'
data_frame_xls=pd.read_excel(file_path)
data_df01 = data_frame_xls[['age']]
print(type(data_df01))
print(res)
Change to
import pandas as pd
#Read xls file
file_path='data/test1226.xls'
data_frame_xls=pd.read_excel(file_path)
data_df01 = data_frame_xls[['age']]
print(type(data_df01))
data_df01 = data_frame_xls['age']
print(type(data_df01 ))
res = data_df01 .tolist()
print(res)
Ha ha, it’s done!
Read More:
- [Solved] AttributeError: ‘DataFrame‘ object has no attribute ‘map‘
- [Solved] AttributeError: DataFrame object has no attribute’xxx’
- How to Solve attributeerror: ‘list’ object has no attribute ‘shape‘
- AttributeError: DatetimeProperties object has no attribute
- [Solved] AttributeError WriteOnlyWorksheet object has no attribute cell
- [Solved] AttributeError: ‘PngImageFile‘ object has no attribute ‘imshow‘
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘astype‘
- [Solved] AttributeError: ‘DataParallel‘ object has no attribute ‘save‘
- [Solved] AttributeError: ‘str‘ object has no attribute ‘decode‘
- [Solved] Networkx Error: Attributeerror: ‘graph’ object has no attribute ‘node’
- [Solved] AttributeError: ‘HTMLWriter‘ object has no attribute ‘_temp_names‘
- [Solved] vpython: AttributeError: ‘box‘ object has no attribute ‘idx‘
- [Solved] AttributeError: ‘NoneType‘ object has no attribute ‘append‘
- [Solved] Paramiko error: AttributeError: ‘NoneType’ object has no attribute ‘time’
- [Solved] AttributeError: ‘str‘ object has no attribute ‘decode‘
- [Solved] Pycharm error: attributeerror: ‘Htmlparser’ object has no attribute ‘unescape’
- [2021-10-05] Python Error: AttributeError: ‘NoneType‘ object has no attribute ‘append‘
- [Solved] LeNet Script Train Error: AttributeError: ‘DictIterator’ object has no attribute ‘get_next’
- [Solved] pandas ExcelWrite AttributeError: ‘NoneType‘ object has no attribute ‘group‘
- [Solved] AttributeError: ‘_IncompatibleKeys’ object has no attribute