Skip to content

Commit 4f888ce

Browse files
committed
Fix docstrings for �oxplot, get_group, and indices methods
1 parent ee0902a commit 4f888ce

File tree

3 files changed

+37
-12
lines changed

3 files changed

+37
-12
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8888
-i "pandas.arrays.IntervalArray.length SA01" \
8989
-i "pandas.arrays.NumpyExtensionArray SA01" \
9090
-i "pandas.arrays.TimedeltaArray PR07,SA01" \
91-
-i "pandas.core.groupby.DataFrameGroupBy.boxplot PR07,RT03,SA01" \
92-
-i "pandas.core.groupby.DataFrameGroupBy.get_group RT03,SA01" \
93-
-i "pandas.core.groupby.DataFrameGroupBy.indices SA01" \
9491
-i "pandas.core.groupby.DataFrameGroupBy.nunique SA01" \
9592
-i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \
9693
-i "pandas.core.groupby.DataFrameGroupBy.sem SA01" \

pandas/core/groupby/groupby.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,12 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]:
515515
"""
516516
Dict {group name -> group indices}.
517517
518+
See Also
519+
--------
520+
DataFrame.groupby : Apply a groupby operation on a DataFrame.
521+
Series.groupby : Apply a groupby operation on a Series.
522+
Resampler.indices : Return the indices of the groups in a resampler.
523+
518524
Examples
519525
--------
520526
@@ -564,6 +570,7 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]:
564570
"""
565571
return self._grouper.indices
566572

573+
567574
@final
568575
def _get_indices(self, names):
569576
"""
@@ -707,7 +714,14 @@ def get_group(self, name) -> DataFrame | Series:
707714
Returns
708715
-------
709716
DataFrame or Series
717+
A DataFrame or Series corresponding to the group with the specified name.
710718
719+
See Also
720+
--------
721+
DataFrame.groupby : Apply a groupby operation on a DataFrame.
722+
Series.groupby : Apply a groupby operation on a Series.
723+
Resampler.get_group : Get a group from a resampler.
724+
711725
Examples
712726
--------
713727

pandas/plotting/_core.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -570,19 +570,24 @@ def boxplot_frame_groupby(
570570
571571
Parameters
572572
----------
573-
grouped : Grouped DataFrame
573+
grouped : DataFrameGroupBy
574+
The grouped DataFrame to plot.
574575
subplots : bool
575576
* ``False`` - no subplots will be used
576577
* ``True`` - create a subplot for each group.
577-
578578
column : column name or list of names, or vector
579579
Can be any valid input to groupby.
580-
fontsize : float or str
581-
rot : label rotation angle
582-
grid : Setting this to True will show the grid
580+
fontsize : int or None
581+
Font size for the labels.
582+
rot : int
583+
Rotation angle of the labels.
584+
grid : bool
585+
Setting this to True will show the grid.
583586
ax : Matplotlib axis object, default None
584-
figsize : A tuple (width, height) in inches
585-
layout : tuple (optional)
587+
An axis object to plot on. If None, a new figure and axis will be created.
588+
figsize : tuple of (float, float) or None
589+
A tuple (width, height) in inches.
590+
layout : tuple of (int, int) or None
586591
The layout of the plot: (rows, columns).
587592
sharex : bool, default False
588593
Whether x-axes will be shared among subplots.
@@ -599,8 +604,17 @@ def boxplot_frame_groupby(
599604
600605
Returns
601606
-------
602-
dict of key/value = group key/DataFrame.boxplot return value
603-
or DataFrame.boxplot return value in case subplots=figures=False
607+
dict of key/value pairs or DataFrame.boxplot
608+
When subplots=True, returns a dictionary where keys are group names and
609+
values are the matplotlib BoxPlot objects for each group.
610+
When subplots=False, returns a single matplotlib BoxPlot object for the
611+
combined plot.
612+
613+
See Also
614+
--------
615+
DataFrame.boxplot : Make box plots from DataFrame data.
616+
Series.boxplot : Make box plots from Series data.
617+
pandas.plotting.boxplot : Lower-level method for creating box plots.
604618
605619
Examples
606620
--------

0 commit comments

Comments
 (0)