I have a pandas data frame, called df.
df
I want to save this in a gzipped format. One way to do this is the following:
import gzip import pand
You can dump dataframe into string using pickle.dumps and then write it on disk with import gzip
file = gzip.GzipFile('filename.pickle.gz', 'wb', 3) file.write(pickle.dumps(df)) file.close()