python相关
不使用科学计数法显示坐标轴
ax.ticklabel_format(useOffset=False)
求和运算
∑
m
=
0
30
m
?
z
\sum_{m=0}^{30}m*z
m=0∑30?m?z
%matplolib inline
from __future__ import print_function, division
import numpy as np
m=np.arange(1,5,1).reshape(-1,1)
z=np.arange(1,5,1).reshape(1,-1)
m.dot(z).sum()

map函数
import math
def Hs(z,x,m):
return sum(map(lambda m:(m*z/x),range(1,m)))
Hs(10,2,10)

python安装whl的文件
cd 文件所在目录
pip install 文件名.whl
参考链接:https://jingyan.baidu.com/article/d45ad14857168e69552b801f.html
python安装tar.gz的文件 先解压
cd 文件所在目录
python setup.py install

通过循环方式设置坐标轴粗细
ax=plt.gca()
axloc=['bottom','top','left','right']
for i in axloc:
ax.spines[i].set_linewidth(2)
|