没有名为“Pandas”的模块

2024-04-25 13:41:43 发布

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

这是我尝试运行的以下代码:

dict = {"country": ["Brazil", "Russia", "India", "China", "South Africa"],
       "capital": ["Brasilia", "Moscow", "New Dehli", "Beijing", "Pretoria"],
       "area": [8.516, 17.10, 3.286, 9.597, 1.221],
       "population": [200.4, 143.5, 1252, 1357, 52.98] }

# import pandas as pd
import Pandas as pd
f=pd.DataFrame(dict)
print(f)

但不幸的是,这出现在VS代码终端上,我试图找到解决方案,但没有得到正确的答案。请允许我听听你的意见

*Traceback (most recent call last):
  File "d:/Python/Learn Python/Pandas basics/Pdf.py", line 7, in <module>
    import Pandas as pd
ModuleNotFoundError: No module named 'Pandas'*

Tags: 代码importpandasascountrydictpdmodule