【Functions of Numpy】np.ravel()

 example:

a = np.floor(10 * rg.random((3, 4)))
print(a.shape)
a = a.ravel()
print(a)
print(a.shape)

result:

(3, 4)
[5. 9. 1. 9. 3. 4. 8. 4. 5. 0. 7. 5.]
(12,)

你可能感兴趣的:(Python,numpy,python,机器学习)