- 博客(2)
- 收藏
- 关注
原创 python3 reshape
A trick when you want to flatten a matrix X of shape (a,b,c,d) to a matrix X_flatten of shape (bcd, a) is to use:X_flatten = X.reshape(X.shape[0], -1).Treshape(行,列)可以根据指定的数值将数据转换为特定的行数和列数reshape(1,...
2019-07-14 21:49:35
310
转载 numpy.array 的shape属性理解
import numpy as np二维y = np.array([[1,2,3],[4,5,6]])print(y)[[1 2 3][4 5 6]]print(y.shape) # 展示行数,列数(2, 3)print(y.shape[0]) # 展示行数print(y.shape[1]) # 展示列数三维x = np.arr...
2019-07-10 21:14:42
1132
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅