python用pip安装numpy mac_Mac下python安装numpy,pandas,matplotlib
numpy是數(shù)據(jù)分析的庫,我的目的是分析股票的數(shù)據(jù),Pandas 有兩種自己獨(dú)有的基本數(shù)據(jù)結(jié)構(gòu)Series (一維)和 DataFrame(二維),它們讓數(shù)據(jù)操作更簡(jiǎn)單了。它也是 Python 的一個(gè)庫,所以,Python 中有的數(shù)據(jù)類型在這里依然適用,也同樣還可以使用類自己定義數(shù)據(jù)類型。
Pandas是以NumPy和Matplotlib為基礎(chǔ)封裝的金融數(shù)據(jù)分析的庫,對(duì)于量化交易十分有用,通過可視化的效果能幫我們一定程度分析股市的走向。
Python3若沒有pip安裝numpy時(shí)會(huì)報(bào)錯(cuò)
No module named pip
解決辦法兩行命令
python -m ensurepip
easy_install pip
# 若有權(quán)限錯(cuò)誤,則在命令前面添加sudo
sudo easy_install pip
Mac下安裝Numpy
直接用下面命令:pip install numpy
報(bào)錯(cuò)
Requirement already satisfied: numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.8.0rc1)
這是因?yàn)閜ython2.7下有numpy,改一下命令python3 -m pip install Numpy
如下表示安裝成功了
The scripts f2py, f2py3 and f2py3.7 are installed in '/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.16.0
后面的操作就比較簡(jiǎn)單了python3 -m pip install pandas
python3 -m pip install wordcloud
python3 -m pip install matplotlib
簡(jiǎn)單使用一下吧
import numpy as np
import pandas as pd
#創(chuàng)建一維數(shù)組
a = np.arange(10)
print(a)
s = pd.Series(a)
print(s)
輸出如下(本地截個(gè)圖)
晴雨FF - qydq 2019-01-27 15:42
Pandas,歡迎大家到成都看大熊貓-_-
總結(jié)
以上是生活随笔為你收集整理的python用pip安装numpy mac_Mac下python安装numpy,pandas,matplotlib的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 云闪付风控怎么解除?
- 下一篇: python数据处理常用函数_Pytho