-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: xz compression in to_csv() resolves #11852 #12668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -43,6 +43,7 @@ Other Enhancements | |||
^^^^^^^^^^^^^^^^^^ | |||
|
|||
- ``pd.read_msgpack()`` now always gives writeable ndarrays even when compression is used (:issue:`12359`). | |||
- It is possible to use xz compression when writing a DataFrame to CSV (:issue:`11852`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and reading
can do this on top of #12175 as that added compression inference and reorged the testing |
try: | ||
import lzma | ||
except ImportError: | ||
from backports import lzma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only do this if its PY2 (otherwise the ImportError
should just raise)
Updated docs to include reading, using PY3 / PY2 instead of except, will rebase when #12175 gets merged. |
ok #12175 was merged, pls rebase |
also note #12688 |
interesting this only appears in 2 locations (and not the 3rd). any idea? |
@@ -58,6 +58,7 @@ Other Enhancements | |||
|
|||
- ``pd.read_csv()`` now supports opening ZIP files that contains a single CSV, via extension inference or explict ``compression='zip'`` (:issue:`12175`) | |||
- ``pd.read_msgpack()`` now always gives writeable ndarrays even when compression is used (:issue:`12359`). | |||
- It is possible to use xz compression when writing to and/or reading from a DataFrame in CSV (:issue:`11852`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put the right below line 59, and word similarly.
@jreback For now I will also add it to |
@jreback Updated |
the ZIP file must contain only one data file to be read in. | ||
Set to ``None`` for no decompression. | ||
|
||
.. versionadded:: 0.18.0 support for 'zip' compression. | ||
.. versionadded:: 0.18.0 support for 'zip' and 'xz' compression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was a typo actually, make this 0.18.1
minor doc fix |
@jreback fixed typo |
ok, lgtm. ping when green. |
@jreback green |
@terfn thanks! I refactored to remove some duplicate code, but looks really good!. |
git diff upstream/master | flake8 --diff