[英]AttributeError: 'df' object has no attribute 'dtype'
I was importing an xlsx file to Google Colab using code我正在使用代码将 xlsx 文件导入 Google Colab
df = pd.ExcelFile('/content/gdrive/My Drive/df.xlsx')
and encountered error并遇到错误
AttributeError: 'ExcelFile' object has no attribute 'dtype'.
AttributeError:“ExcelFile”object 没有属性“dtype”。
I was expecting df4 to be a DataFrame and check its shape.我期待 df4 成为 DataFrame 并检查它的形状。 How can I do this?
我怎样才能做到这一点? Thank you.
谢谢你。
According to documentation , the proper way to read the excel file is:根据文档,读取 excel 文件的正确方法是:
dfs = pd.read_excel(file_name, sheet_name=None)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.