Pandas学习
Posted hiv
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Pandas学习相关的知识,希望对你有一定的参考价值。
1. 下载安装PyCharm(pycharm-community-2021.1.1.exe)
2. 无法编译成功
import numpy as np
import pandas as pd
def print_hi():
# Use a breakpoint in the code line below to debug your script.
print(pd.Series([1, 3, 5, np.nan, 6, 8])) # Press Ctrl+F8 to toggle the breakpoint.
# Press the green button in the gutter to run the script.
if __name__ == \'__main__\':
print_hi()
3. 尝试安装 py -m pip install numpy
和 pip3 install numpy
https://stackoverflow.com/questions/7818811/import-error-no-module-named-numpy
PS C:\\Users\\test> py -m pip install numpy
Collecting numpy
Downloading numpy-1.20.3-cp39-cp39-win_amd64.whl (13.7 MB)
|████████████████████████████████| 13.7 MB 3.3 MB/s
Installing collected packages: numpy
Successfully installed numpy-1.20.3
PS C:\\Users\\test> pip3 install numpy
Requirement already satisfied: numpy in c:\\users\\test\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (1.20.3)
尽管安装成功,但PyCharm仍然无法成功运行
4. 在PyCharm重新安装numpy和pandas后成功编译
https://blog.csdn.net/defonds/article/details/108055633
File --> Settings… -> Project: test-pandas -> Python Interpreter
5. 运行结果
C:\\test-pandas\\venv\\Scripts\\python.exe C:/test-pandas/main.py
0 1.0
1 3.0
2 5.0
3 NaN
4 6.0
5 8.0
dtype: float64
以上是关于Pandas学习的主要内容,如果未能解决你的问题,请参考以下文章