I am currently saving some data from a process.
np.save('stochastic_data',(rho_av,rho_std))
where rho_av and rho_std are arrays.
However, this data depends on some parameters, say E, k, and M. For each of them, I get different data. But I am only saving the data for a given set of parameters, i.e. I fix (E, k, M), I get the data and I save it. However, from the data I have it is not possible to retrieve the set of parameters (E, k, M). Therefore, I would like to save this set with my array.
My first approach was to simply do
np.save('stochastic_data',(rho_av,rho_std, E, k, M))
but this doesn't work because my parameters are floats, not arrays.
My second approach was simply to convert the set of parameters to arrays. Basically, to create an array of identical elements for each parameters, i.e. E-> np.array(E,E,.....,E). However, my arrays are quite big (np.shape(rho_av)=(100000,1000)), so saving the parameters with this shape is not going to be efficient.
Is there a more efficient way to do it?
Thanks.