Python - 无法导入熊猫

Python - 无法导入熊猫

每当我想要运行我的代码时,我都会遇到同样的错误。

Traceback (most recent call last):
  File "paises.py", line 1, in <module>
    from pandas import DataFrame, Series
  File "/home/david/Documents/Projetos/Intro to Data Science/pandas.py", line 1, in <module>
    from pandas import DataFrame
ImportError: cannot import name DataFrame

我的代码是:

from pandas import DataFrame

另一个错误:

Traceback (most recent call last): 
  File "knowingPandas.py", line 1, in <module>
    import pandas as pd
  File "/home/david/Documents/Projetos/Intro to Data Science/pandas.py", line 1
    adium-theme-ubuntu==0.3.4
                            ^   
SyntaxError: invalid syntax

答案1

这里的问题在于我尝试运行的文件的名称。我pandas.py将的名称更改为pta.py

相关内容