python下的numpy模塊的常用方法(總結)

創建數組  創建一維數組   arr = np.array([1, 2, 3, 4])  ## 一維數組 創建二維數組 arr2 = np.array([[1, 2, 3, 4], [4, 6, 7, 8], [7, 8, 9, 10]])   數組的屬性 ndim  數組維度 shape 數組結構 shape[1] 或shape[0],查看數組列  行數 dtype  數組元素類型 size 
相關文章
相關標籤/搜索