I have an array with unknown length (for example lets use 11). so the array is
[1,2,3,4,5,6,7,8,9,10,11]
I want to reshape that array so he will have 5 columns and as much rows as needed. I know I can use reshape(-1,5)
that way it creates the rows based on the array length.
But it gives me this error:
ValueError: cannot reshape array of size 11 into shape (5)
Any idea how do I do that? the desired result is:
[[1,2,3,4,5],
[6,7,8,9,10],
[11,None,None,None,None]]
The code that I ran and got this error is:
import numpy as np
a = np.array([1,2,3,4,5,6,7,8,9,10,11])
print(np.reshape(a, (-1,5)))