You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* DEPR: Change boxplot return_type kwarg
Part of #6581
Deprecation started in #7096
Changes the default value of `return_type` in DataFrame.boxplot
and DataFrame.plot.box from None to 'axes'.
* API: Change faceted boxplot return_type
Aligns behavior of `Groupby.boxplot` and DataFrame.boxplot(by=.)
to return a Series.
Copy file name to clipboardExpand all lines: doc/source/visualization.rst
+18-17
Original file line number
Diff line number
Diff line change
@@ -456,28 +456,29 @@ columns:
456
456
457
457
.. _visualization.box.return:
458
458
459
-
Basically, plot functions return :class:`matplotlib Axes <matplotlib.axes.Axes>` as a return value.
460
-
In ``boxplot``, the return type can be changed by argument ``return_type``, and whether the subplots is enabled (``subplots=True`` in ``plot`` or ``by`` is specified in ``boxplot``).
459
+
.. warning::
461
460
462
-
When ``subplots=False`` / ``by`` is ``None``:
461
+
The default changed from ``'dict'`` to ``'axes'`` in version 0.19.0.
463
462
464
-
* if ``return_type`` is ``'dict'``, a dictionary containing the :class:`matplotlib Lines <matplotlib.lines.Line2D>` is returned. The keys are "boxes", "caps", "fliers", "medians", and "whiskers".
465
-
This is the default of ``boxplot`` in historical reason.
466
-
Note that ``plot.box()`` returns ``Axes`` by default same as other plots.
467
-
* if ``return_type`` is ``'axes'``, a :class:`matplotlib Axes <matplotlib.axes.Axes>` containing the boxplot is returned.
468
-
* if ``return_type`` is ``'both'`` a namedtuple containing the :class:`matplotlib Axes <matplotlib.axes.Axes>`
469
-
and :class:`matplotlib Lines <matplotlib.lines.Line2D>` is returned
463
+
In ``boxplot``, the return type can be controlled by the ``return_type``, keyword. The valid choices are ``{"axes", "dict", "both", None}``.
464
+
Faceting, created by ``DataFrame.boxplot`` with the ``by``
465
+
keyword, will affect the output type as well:
470
466
471
-
When ``subplots=True`` / ``by`` is some column of the DataFrame:
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.19.0.txt
+2-1
Original file line number
Diff line number
Diff line change
@@ -494,6 +494,7 @@ API changes
494
494
- ``__setitem__`` will no longer apply a callable rhs as a function instead of storing it. Call ``where`` directly to get the previous behavior. (:issue:`13299`)
495
495
- Passing ``Period`` with multiple frequencies to normal ``Index`` now returns ``Index`` with ``object`` dtype (:issue:`13664`)
496
496
- ``PeriodIndex.fillna`` with ``Period`` has different freq now coerces to ``object`` dtype (:issue:`13664`)
497
+
- Faceted boxplots from ``DataFrame.boxplot(by=col)`` now return a ``Series`` when ``return_type`` is not None. Previously these returned an ``OrderedDict``. Note that when ``return_type=None``, the default, these still return a 2-D NumPy array. (:issue:`12216`, :issue:`7096`)
497
498
- More informative exceptions are passed through the csv parser. The exception type would now be the original exception type instead of ``CParserError``. (:issue:`13652`)
498
499
- ``astype()`` will now accept a dict of column name to data types mapping as the ``dtype`` argument. (:issue:`12086`)
499
500
- The ``pd.read_json`` and ``DataFrame.to_json`` has gained support for reading and writing json lines with ``lines`` option see :ref:`Line delimited json <io.jsonl>` (:issue:`9180`)
@@ -1282,9 +1283,9 @@ Removal of prior version deprecations/changes
1282
1283
1283
1284
Now legacy time rules raises ``ValueError``. For the list of currently supported offsets, see :ref:`here <timeseries.offset_aliases>`
1284
1285
1286
+
- The default value for the ``return_type`` parameter for ``DataFrame.plot.box`` and ``DataFrame.boxplot`` changed from ``None`` to ``"axes"``. These methods will now return a matplotlib axes by default instead of a dictionary of artists. See :ref:`here <visualization.box.return>` (:issue:`6581`).
1285
1287
- The ``tquery`` and ``uquery`` functions in the ``pandas.io.sql`` module are removed (:issue:`5950`).
0 commit comments