AttributeError:“df”对象没有属性“dtype”

2024-04-25 22:40:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用代码将xlsx文件导入到googlecolab

df = pd.ExcelFile('/content/gdrive/My Drive/df.xlsx')

并遇到错误

AttributeError: 'ExcelFile' object has no attribute 'dtype'.

我希望df4是一个数据帧并检查它的形状。我该怎么做?非常感谢。你知道吗


Tags: 文件代码dfobjectmy错误drivecontent