Use numpy flatten
Closed this issue · 0 comments
Hattomo commented
Description
np.flutten()
changes numpy array to 1d
#my terminal
a=np.array([[[[1,2,3],[4,5,6],[7,8,9]],[[21,22,23],[24,25,26],[27,28,29]],[[31,32,33],[34,35,36],[37,38,39]]]])
>>> a.shape
(1, 3, 3, 3)
>>> a.flatten()
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 22, 23, 24, 25, 26, 27, 28,
29, 31, 32, 33, 34, 35, 36, 37, 38, 39])
Check list
- [ ]