I have a 4d array of shape like this. It has total 18*100 = 1800 rows and 30 dimensional outputs per row
(18, 100, 30, 1, 1)
i want to convert or reshape this into 2d array, the easiest way
(1800,30)
Sorry for being so naive with numpy, but please i am a novice user. Any help much appreciated.
numpy.reshape(input_in_4D, (1800,30))
Of course this just converts the input in the default order (meaning you "unroll" the input array from inner to outer); if you need special ordering, you should read up on slicing.
You can use reshape
method:
newArray = oldArray.reshape(1800,30)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With