Save pandas dataframe to file including index

Viewed 27

Which file format can be used to save a Pandas DataFrame object and then loading it back with the proper index? I.e. if column blah was an index before saving it to the file, I want that after loading it back again blah to be an index without me having to tell this to Pandas.

1 Answers
df.to_pickle('file.pickle')
df = pd.read_pickle('file.pickle')
Related