I am trying to convert a simple array into (m,n) shape but it has less than m*n elements.
My code:
list = [1,2,3,4,5]
ary = np.array(list)
reary = ary.reshpae(2,3)
Present answer:
ValueError: cannot reshape array of size 5 into shape (2,3)
Expected answer:
reary =
[[1,2,3],
[4,5]]
reary
does not have a shape of (2,3) – ssm