Skip to content

Commit 1ba8f3a

Browse files
committed
DOC: versionchanged & tweaks
1 parent 25bdb4c commit 1ba8f3a

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

doc/source/whatsnew/v0.24.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Other Enhancements
177177
- :func:`read_html` copies cell data across ``colspan`` and ``rowspan``, and it treats all-``th`` table rows as headers if ``header`` kwarg is not given and there is no ``thead`` (:issue:`17054`)
178178
- :meth:`Series.nlargest`, :meth:`Series.nsmallest`, :meth:`DataFrame.nlargest`, and :meth:`DataFrame.nsmallest` now accept the value ``"all"`` for the ``keep`` argument. This keeps all ties for the nth largest/smallest value (:issue:`16818`)
179179
- :class:`IntervalIndex` has gained the :meth:`~IntervalIndex.set_closed` method to change the existing ``closed`` value (:issue:`21670`)
180-
- :func:`~DataFrame.to_csv`, :func:`~Series.to_csv`, :func:`~DataFrame.to_json`, and :func:`~Series.to_json` now support ``compression='infer'`` to infer compression based on filename (:issue:`15008`).
180+
- :func:`~DataFrame.to_csv`, :func:`~Series.to_csv`, :func:`~DataFrame.to_json`, and :func:`~Series.to_json` now support ``compression='infer'`` to infer compression based on filename extension (:issue:`15008`).
181181
The default compression for ``to_csv``, ``to_json``, and ``to_pickle`` methods has been updated to ``'infer'`` (:issue:`22004`).
182182
- :func:`to_timedelta` now supports iso-formated timedelta strings (:issue:`21877`)
183183
- :class:`Series` and :class:`DataFrame` now support :class:`Iterable` in constructor (:issue:`2193`)

pandas/core/frame.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,6 +1755,8 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
17551755
If 'infer' and `path_or_buf` is path-like, then detect compression
17561756
from the following extensions: '.gz', '.bz2', '.zip' or '.xz'
17571757
(otherwise no compression).
1758+
.. versionchanged:: 0.24.0
1759+
'infer' option added and set to default
17581760
line_terminator : string, default ``'\n'``
17591761
The newline character or character sequence to use in the output
17601762
file

pandas/core/generic.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,11 +2000,14 @@ def to_json(self, path_or_buf=None, orient=None, date_format=None,
20002000
20012001
.. versionadded:: 0.19.0
20022002
2003-
compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None}, default 'infer'
2003+
compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None},
2004+
default 'infer'
20042005
A string representing the compression to use in the output file,
20052006
only used when the first argument is a filename.
20062007
20072008
.. versionadded:: 0.21.0
2009+
.. versionchanged:: 0.24.0
2010+
'infer' option added and set to default
20082011
20092012
index : boolean, default True
20102013
Whether to include the index values in the JSON string. Not

pandas/core/series.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3795,10 +3795,12 @@ def to_csv(self, path=None, index=True, sep=",", na_rep='',
37953795
encoding : string, optional
37963796
a string representing the encoding to use if the contents are
37973797
non-ascii, for python versions prior to 3
3798-
compression : string, optional
3798+
compression : None or string, default 'infer'
37993799
A string representing the compression to use in the output file.
3800-
Allowed values are 'gzip', 'bz2', 'zip', 'xz'. This input is only
3801-
used when the first argument is a filename. Defaults to 'infer'.
3800+
Allowed values are None, 'gzip', 'bz2', 'zip', 'xz', and 'infer'.
3801+
This input is only used when the first argument is a filename.
3802+
.. versionchanged:: 0.24.0
3803+
'infer' option added and set to default
38023804
date_format: string, default None
38033805
Format string for datetime objects.
38043806
decimal: string, default '.'

0 commit comments

Comments
 (0)