5

I load a very large csv file in a gz format in Pandas 0.18 using

pd=pd.read_csv('myfile.gz')

Without surprise, once the csv is unzipped and loaded into the RAM, it takes a lot of space. However, I still need to save my file after I perform my computations.

Can to_csv store my dataframe in a gz format? The only related question I found on StackOverflow is 3 year old...

Seanny123
  • 8,776
  • 13
  • 68
  • 124
ℕʘʘḆḽḘ
  • 18,566
  • 34
  • 128
  • 235

1 Answers1

11

You could use the parameter compression='gzip'

source

Till
  • 4,183
  • 3
  • 16
  • 18