- 數組中冒號的使用
-
對特徵值和特徵值向量排序
-
返回矩陣中最值下標
print(np.argmin(c))
print(np.argmin(c, axis=0)) # 按每列求出最小值的索引
print(np.argmin(c, axis=1)) # 按每行求出最小值的索引
-
np.zeros
np.zeros( (3,3) ) ,需要填入元組 -
整除
3//2 -
矩陣展平
將多維未知矩陣展開爲一維數組
A.flatten()
-
np.mean
-
array 比較是否相等
a=[]
b=[]
if a==b
a=np.array()
b= np.array()
if (a==b).all()
- 指數運算
np.exp(mat)
- 數組合並
np.append()
np.concatenate()
np.stack()
np.hstack()
np.vstack()
np.dstack()
https://blog.csdn.net/qq_39516859/article/details/80666070
- np.argwhere()
https://blog.csdn.net/u012193416/article/details/79672514
https://blog.csdn.net/qq_18649781/article/details/88861728
- time
time.time() # 時間戳 1459994552.51
time.asctime( time.localtime(time.time()) ) # Thu Apr 7 10:05:21 2016
- 文件及文件夾操作
os.path.exists(path) #判斷文件或文件夾是否存在
# 創建文件夾
os.mkdirs(path) # 單層文件夾
os.makedirs(path) #創建多層文件將愛
- plot 畫圖
# 定義fig
fig = plt.figure()
# 建立子圖
ax = fig.subplots(2,2) # 2*2
# 第一個圖爲
ax[0,1].plot([1,2], [3,4])
# 第二個圖爲
ax[0,1].plot([1,2], [3,4])
# 第三個圖爲
ax[1,0].plot([1,2], [3,4])
# 第四個圖爲
ax[1,1].plot([1,2], [3,4])
- set 轉list
list(set) # set沒有tolist
參考 鏈接
https://www.cnblogs.com/liuys635/p/11209946.html
https://blog.csdn.net/weixin_39223665/article/details/79675927
https://blog.csdn.net/weixin_42074867/article/details/89921831