I want to create a numpy array in order to fill it with numpy arrays. for example:
a = [] (simple array or numpy array)
b = np.array([[5,3],[7,9],[3,8],[2,1]])
a = np.concatenate([a,b])
c = np.array([[1,2],[2,9],[3,0]])
a = np.concatenate([a,c])
I would like to do so because I have wav files from which I extract some features so I can't read from 2 files concurrently but iteratively.
How can I create an empty ndarray with the second dimension fixed e.g. a.shape = (x,2) or how can I concatenate the arrays even without the creation of a "storage" array ?
a = np.empty((0, 2)).concatenateincrementally is really, really slow. It's better to build up a list of arrays to concatenate and thenconcatenatethem all at once.