1. ? ? 安裝pandas
>>升級pip
??????? cd c:\python37\
??????? python3 -m pip install--upgrade pip
>>使用國內(nèi)鏡像
?????? #配置清華PyPI鏡像(如無法運(yùn)行锚国,將pip版本升級到>=10.0.0)
??????? pip config setglobal.index-url https://pypi.tuna.tsinghua.edu.cn/simple
??????? pip install pandas
?????? #取消鏡像設(shè)置
??????? pip config unsetglobal.index-url
??????? 或者:
??????? pip install ** -ihttps://pypi.tuna.tsinghua.edu.cn/simple/
>>本地安裝
??????? 首先cmd進(jìn)入python3安裝路徑下的Scripts文件夾
??????? 輸入pip install jieba
——安裝seaborn
同理,使用國內(nèi)鏡像方式安裝
====!!!注:直接使用pip install **出錯(cuò),就可以采用這種方式
>>本地安裝
在https://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy找到對應(yīng)安裝包
pip install [拖入包]
——pip國內(nèi)鏡像源
清華:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:http://mirrors.aliyun.com/pypi/simple/
中國科技大學(xué)https://pypi.mirrors.ustc.edu.cn/simple/
華中理工大學(xué):http://pypi.hustunique.com/
山東理工大學(xué):http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
?????? 備注:有時(shí)候網(wǎng)絡(luò)狀態(tài)欠佳,會導(dǎo)致國內(nèi)鏡像安裝失敗。多試幾次就好了
2. ? ? 函數(shù)
plt.thetagrids():獲取當(dāng)前極坐標(biāo)圖上的theta網(wǎng)格線
plt.thetagrids(angles,
labels=None, fmt=None, **kwargs):設(shè)置當(dāng)前極坐標(biāo)圖上的theta網(wǎng)格線
plt.grid(b, which,
axis, color, linestyle, linewidth袁串, **kwargs) 生成網(wǎng)格
plt.plot()
plt.subplots_adjust(left=None,bottom=None, right=None, top=None, wspace=None, hspace=None)
有六個(gè)可選參數(shù)來控制子圖布局。值均為0~1之間。其中l(wèi)eft谦去、bottom、right蹦哼、top圍成的區(qū)域就是子圖的區(qū)域鳄哭。wspace、hspace分別表示子圖之間左右纲熏、上下的間距妆丘。實(shí)際的默認(rèn)值由matplotlibrc文件控制的
.unique()
describe() 函數(shù)可以查看數(shù)據(jù)的基本情況,包括:count 非空值數(shù)局劲、mean 平均值勺拣、std 標(biāo)準(zhǔn)差、max 最大值鱼填、min 最小值药有、(25%、50%苹丸、75%)分位數(shù)等愤惰。
matplotlin.pyplot.grid(b,
which, axis, color, linestyle, linewidth,**kwargs)
numpy.linspace(start,
stop, num=50, endpoint=True, retstep=False, dtype=None) 在指定的間隔內(nèi)返回均勻間隔的赘理,一般用前三個(gè)宦言,而前兩個(gè)參數(shù)分別是數(shù)列的開頭與結(jié)尾
numpy.concatenate((a1,a2,...),
axis=0)函數(shù)。能夠一次完成多個(gè)數(shù)組的拼接
.spines設(shè)置坐標(biāo)軸:四個(gè)方向top感憾、bottom蜡励、right、left阻桅。默認(rèn)top和right的顏色設(shè)為None
3. ? ? Matplotlib圖中文的顯示
plt.rcParams['font.sans-serif']= ['Arial Unicode MS']
使用'SimHei'黑體坐標(biāo)軸會出現(xiàn)異沉挂校空框,使用'Arial Unicode MS'解決此問題
4. ? ? 繪制多圖形
>>>對稱子圖(包括一行多個(gè)圖嫂沉,一列多個(gè)圖)
可直接使用subplot
>>>非對稱子圖:每行或者每列的圖形數(shù)量不同時(shí)
?????? (1)gridspec(from matplotlib.gridspec import gridspec)
?????? (2)plt.subplot2grid(import matplot.pyplot as plt)