Home > Software engineering >  Pandas DataFrame .attrs is not saved when saving dataframe with to_csv method
Pandas DataFrame .attrs is not saved when saving dataframe with to_csv method

Time:04-04

I'm using pandas df.attrs method to store metadata in dataframes. Unfortunately those are never saved when I use to_arbitrary_type('filepath') methods. Can someone tell me the correct way to save dataframes such that the df.attrs get saved too?

Thank you!

CodePudding user response:

You cannot save metadata of a dataframe in any file type. You can do so with HD5, as presented here.

  • Related