pandas read_csv() method supports zip archive reading but not to_csv() method supports zip archive saving
<p>Pandas 0.18 supports read_csv zip file as argument and reading zipped csv table correctly into data frame. But when i am trying to use to_csv() method to save data frame as zipped csv, i am getting error. According to official documentation, zip format not supported in to_csv() method. Any thoughts? Thank you.</p>

<p>import pandas as pd</p>

<p>works fine</p>

<p>data = pd.read_csv("E:\ASML SED.zip")</p>

<p>error out
IOError: [Errno 2] No such file or directory: 'E:\ASML SED.zip'</p>

<p>data.to_csv("E:\ASML SED Zipped.zip", compression = 'zip')</p>

<p>Indeed, zip format not supported in to_csv() method according to this <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_csv.html" rel="nofollow">official documentation</a>, the allowed values are âgzipâ, âbz2â, âxzâ.</p>

<p>If you really want the 'zip' format, you can try to save as uncompressed csv file, then using cli to compress the .csv file to .csv.zip.</p>

python csv pandas zip