# pre-allocate data cube
cube = np.empty((len(time_ix), len(data_ix), len(id_ix)))
cube[:] = np.NaN
# filling of cube
tix=3
idx=5
data = cube[tix,:,idx]
Data is describing the values of 20 columns roughly at that day for that id
I am creating a cube to slice better my data afterwards, unfortunately by using such statement I can fill my 2nd dimension with the data having data type only float64
that turned to be quite expensive in terms of storage.
I didn't find a way to declare the above mentioned cube as a rec array, in such a way that I could fit into the data_ix
dimension heterogeneous data types.
Alternatively, is there a way to represent a 3d array (cube) with 2 indexes to easily slic (time and id) to get the according dataset with pandas dataframes?