Is it possible to reshape a np.array() and, in case of inconsistency of the new shape, fill the empty spaces with NaN?
Ex:
arr = np.array([1,2,3,4,5,6])
Target, for instance a 2x4 Matrix:
[1 2 3 4]
[5 6 NaN NaN]
I need this to bypass the error: ValueError: cannot reshape array of size 6 into shape (2,4)