关于python的一些操作
数据读取
scipy.io.loadmat('name.mat')
skimage.io.imread('name.png')
skimage.io.imshow(data)
解决中文显示的问题
from matplotlib.font_manager import _rebuild
_rebuild()
matplotlib.rcParams['font.sans-serif']=[u'SimHei']
matplotlib.rcParams['axes.unicode_minus']=False
numpy
A * B
A @ B
np.multiply(A, B)
np.dot(A, B)
A * B
A @ B
np.multiply(A, B)
np.dot(A, B)
np.random.rand()
np.random.rand(3,2)
np.random.randn()
np.random.randn(3,2)
np.random.randint(2,5)
np.random.randint(2,size=5)
np.random.choice(np.arange(4),
size=(3,3),
p=[0.1,0.2,0.3,0.4],
replace=True)