python中numpy的ravel()降维

x = np.array([[1,2,3], [4,5,6]])
print(x.ravel())
[1 2 3 4 5 6]
x = np.array([[1,2,3], [4,5,6], [10,11,12]])
print(x.ravel())
[ 1  2  3  4  5  6 10 11 12]

你可能感兴趣的:(python中numpy的ravel()降维)