Skip to content

Commit a3dea39

Browse files
committed
DOC: fixed typos in GroupBy document
1 parent 8662cb9 commit a3dea39

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

doc/source/groupby.rst

+9-8
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ following:
5252
step and try to return a sensibly combined result if it doesn't fit into
5353
either of the above two categories
5454

55-
Since the set of object instance method on pandas data structures are generally
55+
Since the set of object instance methods on pandas data structures are generally
5656
rich and expressive, we often simply want to invoke, say, a DataFrame function
5757
on each group. The name GroupBy should be quite familiar to those who have used
5858
a SQL-based tool (or ``itertools``), in which you can write code like:
@@ -129,7 +129,7 @@ columns:
129129

130130
In [5]: grouped = df.groupby(get_letter_type, axis=1)
131131

132-
Starting with 0.8, pandas Index objects now supports duplicate values. If a
132+
Starting with 0.8, pandas Index objects now support duplicate values. If a
133133
non-unique index is used as the group key in a groupby operation, all values
134134
for the same index value will be considered to be in one group and thus the
135135
output of aggregation functions will only contain unique index values:
@@ -171,7 +171,8 @@ By default the group keys are sorted during the ``groupby`` operation. You may h
171171
df2.groupby(['X'], sort=False).sum()
172172
173173
174-
Note that ``groupby`` will preserve the order in which *observations* are sorted *within* each group. For example, the groups created by ``groupby()`` below are in the order the appeared in the original ``DataFrame``:
174+
Note that ``groupby`` will preserve the order in which *observations* are sorted *within* each group.
175+
For example, the groups created by ``groupby()`` below are in the order they appeared in the original ``DataFrame``:
175176

176177
.. ipython:: python
177178
@@ -254,7 +255,7 @@ GroupBy with MultiIndex
254255
With :ref:`hierarchically-indexed data <advanced.hierarchical>`, it's quite
255256
natural to group by one of the levels of the hierarchy.
256257

257-
Let's create a series with a two-level ``MultiIndex``.
258+
Let's create a Series with a two-level ``MultiIndex``.
258259

259260
.. ipython:: python
260261
@@ -636,7 +637,7 @@ with NaNs.
636637
637638
dff.groupby('B').filter(lambda x: len(x) > 2, dropna=False)
638639
639-
For dataframes with multiple columns, filters should explicitly specify a column as the filter criterion.
640+
For DataFrames with multiple columns, filters should explicitly specify a column as the filter criterion.
640641

641642
.. ipython:: python
642643
@@ -755,7 +756,7 @@ The dimension of the returned result can also change:
755756
756757
.. note::
757758

758-
``apply`` can act as a reducer, transformer, *or* filter function, depending on exactly what is passed to apply.
759+
``apply`` can act as a reducer, transformer, *or* filter function, depending on exactly what is passed to it.
759760
So depending on the path taken, and exactly what you are grouping. Thus the grouped columns(s) may be included in
760761
the output as well as set the indices.
761762

@@ -789,7 +790,7 @@ Again consider the example DataFrame we've been looking at:
789790
790791
df
791792
792-
Supposed we wished to compute the standard deviation grouped by the ``A``
793+
Suppose we wish to compute the standard deviation grouped by the ``A``
793794
column. There is a slight problem, namely that we don't care about the data in
794795
column ``B``. We refer to this as a "nuisance" column. If the passed
795796
aggregation function can't be applied to some columns, the troublesome columns
@@ -1019,7 +1020,7 @@ Returning a Series to propagate names
10191020
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10201021

10211022
Group DataFrame columns, compute a set of metrics and return a named Series.
1022-
The Series name is used as the name for the column index. This is especially
1023+
The Series name is used as the name for the column index. This is especially
10231024
useful in conjunction with reshaping operations such as stacking in which the
10241025
column index name will be used as the name of the inserted column:
10251026

0 commit comments

Comments
 (0)