@@ -1816,15 +1816,14 @@ def _set_name(
1816
1816
Parrot 20.0
1817
1817
Name: Max Speed, dtype: float64
1818
1818
1819
- We can pass a list of values (Here: ["a", "b", "a", "b"]) to
1820
- group the Series data by custom labels:
1819
+ We can pass a list of values to group the Series data by custom labels:
1821
1820
1822
1821
>>> ser.groupby(["a", "b", "a", "b"]).mean()
1823
1822
a 210.0
1824
1823
b 185.0
1825
1824
Name: Max Speed, dtype: float64
1826
1825
1827
- Grouping by numeric labels yields similar results (Here: [0, 1, 0, 1]) :
1826
+ Grouping by numeric labels yields similar results:
1828
1827
1829
1828
>>> ser.groupby([0, 1, 0, 1]).mean()
1830
1829
0 210.0
@@ -1896,7 +1895,7 @@ def _set_name(
1896
1895
dtype: int64
1897
1896
1898
1897
We can also group by a custom list with NaN values to handle
1899
- missing group labels (Here: ["a", "b", "a", np.nan]) :
1898
+ missing group labels:
1900
1899
1901
1900
>>> arrays = ['Falcon', 'Falcon', 'Parrot', 'Parrot']
1902
1901
>>> ser = pd.Series([390., 350., 30., 20.], index=arrays, name="Max Speed")
0 commit comments