Python pandas to_csv zip format
问题 I am having a peculiar problem when writing zip files through to_csv. Using GZIP: df.to_csv(path_or_buf = 'sample.csv.gz', compression="gzip", index = None, sep = ",", header=True, encoding='utf-8-sig') gives a neat gzip file with name ' sample.csv.gz ' and inside it I get my csv ' sample.csv ' However, things change when using ZIP df.to_csv(path_or_buf = 'sample.csv.zip', compression="zip", index = None, sep = ",", header=True, encoding='utf-8-sig') gives a zip file with name ' sample.csv