Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
df.to_csv ignores compression when provided with a file handle #21227
Code at issue
with open(outputfile, "w") as file_handle: df2.to_csv(file_handle, compression='gzip')
The written file is not gzip compressed.
The output should be a gzip compressed csv file. Similar to what is obtained when using:
looks like an existing behaviour dating back to version 0.20 or earlier.
Actually, the documentation of
so it is not supported but may be a new use case perhaps?