I am trying to save a dataframe and a matrix as .npy files with np.save() and then read them using np.load() but I get the following error:
File "/Users/sofiafarina/opt/anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 457, in load
raise ValueError("Cannot load file containing pickled data "
ValueError: Cannot load file containing pickled data when allow_pickle=False
Even if I write allow_pickle=True I get an error:
File "/Users/sofiafarina/opt/anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 463, in load
"Failed to interpret file %s as a pickle" % repr(file))
OSError: Failed to interpret file 'finaldf_p_85_12.npy' as a pickle
So how could I save a df from a python script and then load it in another one? Should I use other functions? Thank you!
pandas
have its own version of save and load? – Pericycle