-1

this is the following code which i was try to run:

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)

but unfortunately this showed up on VS code terminal, i try to found the solution but didnt able to get it with proper answer. Please I will love to hear your opinion .

*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'*
4

2 回答 2

2

pandas 模块名称全部小写。试试import pandas as pd吧。

于 2021-04-09T13:21:46.527 回答
1

Python 区分大小写。大写字母将意味着不同。您必须在小情况下提及所有内容。将熊猫导入为 pd

于 2021-04-09T14:33:21.330 回答