shape reshape

https://stackoverflow.com/questions/10200268/what-does-shape-do-in-for-i-in-rangey-shape0

In [46]: Y = np.arange(12).reshape(3,4)
In [47]: Y
Out[47]: 
array([[ 0,  1,  2,  3],
       [ 4,  5,  6,  7],
       [ 8,  9, 10, 11]])
       
In [48]: Y.shape
Out[48]: (3, 4)

In [49]: Y.shape[0]
Out[49]: 3

猜你喜欢

转载自blog.csdn.net/yaochuyi/article/details/88665142