![](/img/trans.png)
[英]AttributeError: type object 'object' has no attribute 'dtype'
[英]AttributeError: 'df' object has no attribute 'dtype'
我正在使用代码将 xlsx 文件导入 Google Colab
df = pd.ExcelFile('/content/gdrive/My Drive/df.xlsx')
并遇到错误
AttributeError:“ExcelFile”object 没有属性“dtype”。
我期待 df4 成为 DataFrame 并检查它的形状。 我怎样才能做到这一点? 谢谢你。
根据文档,读取 excel 文件的正确方法是:
dfs = pd.read_excel(file_name, sheet_name=None)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.