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
Copy file name to clipboardExpand all lines: doc/source/groupby.rst
+9-8
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ following:
52
52
step and try to return a sensibly combined result if it doesn't fit into
53
53
either of the above two categories
54
54
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
56
56
rich and expressive, we often simply want to invoke, say, a DataFrame function
57
57
on each group. The name GroupBy should be quite familiar to those who have used
58
58
a SQL-based tool (or ``itertools``), in which you can write code like:
@@ -129,7 +129,7 @@ columns:
129
129
130
130
In [5]: grouped = df.groupby(get_letter_type, axis=1)
131
131
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
133
133
non-unique index is used as the group key in a groupby operation, all values
134
134
for the same index value will be considered to be in one group and thus the
135
135
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
171
171
df2.groupby(['X'], sort=False).sum()
172
172
173
173
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``:
175
176
176
177
.. ipython:: python
177
178
@@ -254,7 +255,7 @@ GroupBy with MultiIndex
254
255
With :ref:`hierarchically-indexed data <advanced.hierarchical>`, it's quite
255
256
natural to group by one of the levels of the hierarchy.
256
257
257
-
Let's create a series with a two-level ``MultiIndex``.
258
+
Let's create a Series with a two-level ``MultiIndex``.
0 commit comments