4

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
  • 7,611
  • 11
  • 61
  • 115
ℕʘʘḆḽḘ
  • 17,138
  • 32
  • 109
  • 206

1 Answers1

10

You could use the parameter compression='gzip'

source

Till
  • 3,505
  • 2
  • 15
  • 18