Skip to content

Commit c2ab2bf

Browse files
meeseeksmachinejorisvandenbossche
authored andcommitted
Backport PR #31382: DOC: reduce long error tracebacks in 1.0 whatsnew + some clean-up (#31390)
Co-authored-by: Joris Van den Bossche <[email protected]>
1 parent b905f2b commit c2ab2bf

File tree

1 file changed

+39
-34
lines changed

1 file changed

+39
-34
lines changed

doc/source/whatsnew/v1.0.0.rst

+39-34
Original file line numberDiff line numberDiff line change
@@ -230,26 +230,22 @@ Other enhancements
230230
- Added the ``na_value`` argument to :meth:`Series.to_numpy`, :meth:`Index.to_numpy` and :meth:`DataFrame.to_numpy` to control the value used for missing data (:issue:`30322`)
231231
- :meth:`MultiIndex.from_product` infers level names from inputs if not explicitly provided (:issue:`27292`)
232232
- :meth:`DataFrame.to_latex` now accepts ``caption`` and ``label`` arguments (:issue:`25436`)
233-
- The :ref:`integer dtype <integer_na>` with support for missing values and the
234-
new :ref:`string dtype <text.types>` can now be converted to ``pyarrow`` (>=
235-
0.15.0), which means that it is supported in writing to the Parquet file
236-
format when using the ``pyarrow`` engine. It is currently not yet supported
237-
when converting back to pandas, so it will become an integer or float
238-
(depending on the presence of missing data) or object dtype column. (:issue:`28368`)
233+
- DataFrames with :ref:`nullable integer <integer_na>`, the :ref:`new string dtype <text.types>`
234+
and period data type can now be converted to ``pyarrow`` (>=0.15.0), which means that it is
235+
supported in writing to the Parquet file format when using the ``pyarrow`` engine (:issue:`28368`).
236+
Full roundtrip to parquet (writing and reading back in with :meth:`~DataFrame.to_parquet` / :func:`read_parquet`)
237+
is supported starting with pyarrow >= 0.16 (:issue:`20612`).
238+
- :func:`to_parquet` now appropriately handles the ``schema`` argument for user defined schemas in the pyarrow engine. (:issue:`30270`)
239239
- :meth:`DataFrame.to_json` now accepts an ``indent`` integer argument to enable pretty printing of JSON output (:issue:`12004`)
240240
- :meth:`read_stata` can read Stata 119 dta files. (:issue:`28250`)
241241
- Implemented :meth:`pandas.core.window.Window.var` and :meth:`pandas.core.window.Window.std` functions (:issue:`26597`)
242242
- Added ``encoding`` argument to :meth:`DataFrame.to_string` for non-ascii text (:issue:`28766`)
243243
- Added ``encoding`` argument to :func:`DataFrame.to_html` for non-ascii text (:issue:`28663`)
244244
- :meth:`Styler.background_gradient` now accepts ``vmin`` and ``vmax`` arguments (:issue:`12145`)
245245
- :meth:`Styler.format` added the ``na_rep`` parameter to help format the missing values (:issue:`21527`, :issue:`28358`)
246-
- Roundtripping DataFrames with nullable integer, string and period data types to parquet
247-
(:meth:`~DataFrame.to_parquet` / :func:`read_parquet`) using the `'pyarrow'` engine
248-
now preserve those data types with pyarrow >= 1.0.0 (:issue:`20612`).
249246
- :func:`read_excel` now can read binary Excel (``.xlsb``) files by passing ``engine='pyxlsb'``. For more details and example usage, see the :ref:`Binary Excel files documentation <io.xlsb>`. Closes :issue:`8540`.
250247
- The ``partition_cols`` argument in :meth:`DataFrame.to_parquet` now accepts a string (:issue:`27117`)
251248
- :func:`pandas.read_json` now parses ``NaN``, ``Infinity`` and ``-Infinity`` (:issue:`12213`)
252-
- :func:`to_parquet` now appropriately handles the ``schema`` argument for user defined schemas in the pyarrow engine. (:issue:`30270`)
253249
- DataFrame constructor preserve `ExtensionArray` dtype with `ExtensionArray` (:issue:`11363`)
254250
- :meth:`DataFrame.sort_values` and :meth:`Series.sort_values` have gained ``ignore_index`` keyword to be able to reset index after sorting (:issue:`30114`)
255251
- :meth:`DataFrame.sort_index` and :meth:`Series.sort_index` have gained ``ignore_index`` keyword to reset index (:issue:`30114`)
@@ -312,7 +308,7 @@ To update, use ``MultiIndex.set_names``, which returns a new ``MultiIndex``.
312308
New repr for :class:`~pandas.arrays.IntervalArray`
313309
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
314310

315-
- :class:`pandas.arrays.IntervalArray` adopts a new ``__repr__`` in accordance with other array classes (:issue:`25022`)
311+
:class:`pandas.arrays.IntervalArray` adopts a new ``__repr__`` in accordance with other array classes (:issue:`25022`)
316312

317313
*pandas 0.25.x*
318314

@@ -333,52 +329,62 @@ New repr for :class:`~pandas.arrays.IntervalArray`
333329
``DataFrame.rename`` now only accepts one positional argument
334330
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
335331

336-
- :meth:`DataFrame.rename` would previously accept positional arguments that would lead
337-
to ambiguous or undefined behavior. From pandas 1.0, only the very first argument, which
338-
maps labels to their new names along the default axis, is allowed to be passed by position
339-
(:issue:`29136`).
332+
:meth:`DataFrame.rename` would previously accept positional arguments that would lead
333+
to ambiguous or undefined behavior. From pandas 1.0, only the very first argument, which
334+
maps labels to their new names along the default axis, is allowed to be passed by position
335+
(:issue:`29136`).
336+
337+
.. ipython:: python
338+
:suppress:
339+
340+
df = pd.DataFrame([[1]])
340341
341342
*pandas 0.25.x*
342343

343-
.. code-block:: ipython
344+
.. code-block:: python
344345
345-
In [1]: df = pd.DataFrame([[1]])
346-
In [2]: df.rename({0: 1}, {0: 2})
346+
>>> df = pd.DataFrame([[1]])
347+
>>> df.rename({0: 1}, {0: 2})
347348
FutureWarning: ...Use named arguments to resolve ambiguity...
348-
Out[2]:
349349
2
350350
1 1
351351
352352
*pandas 1.0.0*
353353

354-
.. ipython:: python
355-
:okexcept:
354+
.. code-block:: python
356355
357-
df.rename({0: 1}, {0: 2})
356+
>>> df.rename({0: 1}, {0: 2})
357+
Traceback (most recent call last):
358+
...
359+
TypeError: rename() takes from 1 to 2 positional arguments but 3 were given
358360
359361
Note that errors will now be raised when conflicting or potentially ambiguous arguments are provided.
360362

361363
*pandas 0.25.x*
362364

363-
.. code-block:: ipython
365+
.. code-block:: python
364366
365-
In [1]: df.rename({0: 1}, index={0: 2})
366-
Out[1]:
367+
>>> df.rename({0: 1}, index={0: 2})
367368
0
368369
1 1
369370
370-
In [2]: df.rename(mapper={0: 1}, index={0: 2})
371-
Out[2]:
371+
>>> df.rename(mapper={0: 1}, index={0: 2})
372372
0
373373
2 1
374374
375375
*pandas 1.0.0*
376376

377-
.. ipython:: python
378-
:okexcept:
377+
.. code-block:: python
378+
379+
>>> df.rename({0: 1}, index={0: 2})
380+
Traceback (most recent call last):
381+
...
382+
TypeError: Cannot specify both 'mapper' and any of 'index' or 'columns'
379383
380-
df.rename({0: 1}, index={0: 2})
381-
df.rename(mapper={0: 1}, index={0: 2})
384+
>>> df.rename(mapper={0: 1}, index={0: 2})
385+
Traceback (most recent call last):
386+
...
387+
TypeError: Cannot specify both 'mapper' and any of 'index' or 'columns'
382388
383389
You can still change the axis along which the first positional argument is applied by
384390
supplying the ``axis`` keyword argument.
@@ -398,7 +404,7 @@ keywords.
398404
Extended verbose info output for :class:`~pandas.DataFrame`
399405
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
400406

401-
- :meth:`DataFrame.info` now shows line numbers for the columns summary (:issue:`17304`)
407+
:meth:`DataFrame.info` now shows line numbers for the columns summary (:issue:`17304`)
402408

403409
*pandas 0.25.x*
404410

@@ -700,13 +706,12 @@ See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for mor
700706
Other API changes
701707
^^^^^^^^^^^^^^^^^
702708

703-
- Bumped the minimum supported version of ``s3fs`` from 0.0.8 to 0.3.0 (:issue:`28616`)
704709
- :class:`core.groupby.GroupBy.transform` now raises on invalid operation names (:issue:`27489`)
705710
- :meth:`pandas.api.types.infer_dtype` will now return "integer-na" for integer and ``np.nan`` mix (:issue:`27283`)
706711
- :meth:`MultiIndex.from_arrays` will no longer infer names from arrays if ``names=None`` is explicitly provided (:issue:`27292`)
707712
- In order to improve tab-completion, Pandas does not include most deprecated attributes when introspecting a pandas object using ``dir`` (e.g. ``dir(df)``).
708713
To see which attributes are excluded, see an object's ``_deprecations`` attribute, for example ``pd.DataFrame._deprecations`` (:issue:`28805`).
709-
- The returned dtype of ::func:`pd.unique` now matches the input dtype. (:issue:`27874`)
714+
- The returned dtype of :func:`unique` now matches the input dtype. (:issue:`27874`)
710715
- Changed the default configuration value for ``options.matplotlib.register_converters`` from ``True`` to ``"auto"`` (:issue:`18720`).
711716
Now, pandas custom formatters will only be applied to plots created by pandas, through :meth:`~DataFrame.plot`.
712717
Previously, pandas' formatters would be applied to all plots created *after* a :meth:`~DataFrame.plot`.

0 commit comments

Comments
 (0)