AttributeError: list object has no attribute iloc
时间: 2023-10-25 15:10:40 浏览: 222
python报错: 'list' object has no attribute 'shape'的解决
5星 · 资源好评率100%
`iloc` is an attribute of a Pandas DataFrame or Series object, not a list object.
If you are trying to access a specific element within a list, you can use indexing to retrieve the element at a specific position. For example, if you have a list `my_list` and you want to retrieve the element at index 0, you can use `my_list[0]`.
If you are trying to use `iloc` on a DataFrame or Series object but are receiving this error, it may be because you are trying to apply it to a list object instead. Make sure you have properly converted your data to a Pandas DataFrame or Series before trying to use the `iloc` attribute.
阅读全文