I don't know the number of rows and columns of a 2d array (a) I need in advance:
a = np.empty( (0,0), dtype=np.uint8 )
a.ndim
2
I managed to convert each line I read from a file to an 1d array of bytes called line
I want to add/append each line to a, so I tried :
np.vstack( (a,line) )
but I get :
ValueError: all the input arrays must have same number of dimensions
And if I call a=np.append(a,line), the number of dimensions becomes 1
Can you help ?
np.arrayon it?gatheringand how do I do that ?lineis an array ofuint8, example :[201, 81, 237, 230]