I am trying to sort a DataFrame using
import pandas as pd from pandas import DataFrame data = pd.read_table('Purchases.tsv',index_col='coreuserid') data.to_pickle('Purchases.pkl')
I worked on the βdataβ for some time, and I had no problems, so I know that this is not a problem with data corruption. I think the syntax is probably, but I tried several options. I'm embarrassed to give an error message, but it ends with:
\pickle.pyc in to_pickle(obj, path) 13 """ 14 with open(path, 'wb') as f: 15 pkl.dump(obj, f, protocol=pkl.HIGHEST_PROTOCOL) SystemError: error return without exception set
The Purchases.pkl file is created, but if I call
data = pd.read_pickle('Purchases.pkl')
I get an EOFError. I use Canopy 1.4, so pandas 0.13.1, which must be recent enough to have this functionality.
python pandas pickle canopy
Keith
source share