numpy 辨异(二) —— np.identity()/np.eye()
生活随笔
收集整理的這篇文章主要介紹了
numpy 辨异(二) —— np.identity()/np.eye()
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
import numpy as np;
兩者在創(chuàng)建單位矩陣上,并無區(qū)別,兩者的區(qū)別主要在接口上;
np.identity(n, dtype=None):只能獲取方陣,也即標準意義的單位陣;
np.eye(N, M=None, k=0, dtype=<type ‘float’>);
N : int,Number of rows in the output.(行數,必選)
M : int, optional,Number of columns in the output. If None, defaults to N.()
- k : int, optional,Index of the diagonal: 0 (the default) refers to the main diagonal,
- a positive value refers to an upper diagonal,
- and a negative value to a lower diagonal.
轉載于:https://www.cnblogs.com/mtcnn/p/9423131.html
總結
以上是生活随笔為你收集整理的numpy 辨异(二) —— np.identity()/np.eye()的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 6.4(2)
- 下一篇: Nginx基础知识之————日志管理