Skip to content

Commit c9d83bf

Browse files
committed
[WIP] DOC Fixes #8447 Printing result types for different return_type values
1 parent 819f457 commit c9d83bf

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

pandas/plotting/_core.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -2130,24 +2130,25 @@ def plot_series(data, kind='line', ax=None, # Series unique
21302130
returned by `boxplot`. When ``return_type='axes'`` is selected,
21312131
the matplotlib axes on which the boxplot is drawn are returned:
21322132
2133-
>>> df.boxplot(column=['Col1','Col2'], return_type='axes')
2134-
<matplotlib.axes._subplots.AxesSubplot object at ...>
2133+
>>> boxplot = df.boxplot(column=['Col1','Col2'], return_type='axes')
2134+
>>> type(boxplot)
2135+
<class 'matplotlib.axes._subplots.AxesSubplot'>
21352136
21362137
When grouping with ``by``, a Series mapping columns to ``return_type``
21372138
is returned:
21382139
2139-
>>> df.boxplot(column=['Col1','Col2'], by='X', return_type='axes')
2140-
Col1 AxesSubplot(0.1,0.15;0.363636x0.75)
2141-
Col2 AxesSubplot(0.536364,0.15;0.363636x0.75)
2142-
dtype: object
2140+
>>> boxplot = df.boxplot(column=['Col1','Col2'], by='X',
2141+
... return_type='axes')
2142+
>>> type(boxplot)
2143+
<class 'pandas.core.series.Series'>
21432144
21442145
If ``return_type`` is `None`, a NumPy array of axes with the same shape
21452146
as ``layout`` is returned:
21462147
2147-
>>> df.boxplot(column=['Col1','Col2'], by='X', return_type=None)
2148-
array([<matplotlib.axes._subplots.AxesSubplot object at ...>,
2149-
<matplotlib.axes._subplots.AxesSubplot object at ...>],
2150-
dtype=object)
2148+
>>> boxplot = df.boxplot(column=['Col1','Col2'], by='X',
2149+
... return_type=None)
2150+
>>> type(boxplot)
2151+
<class 'numpy.ndarray'>
21512152
"""
21522153

21532154

0 commit comments

Comments
 (0)