-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Contribute to issue #15580 #28264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contribute to issue #15580 #28264
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,7 +183,7 @@ By default the group keys are sorted during the ``groupby`` operation. You may h | |
|
||
.. ipython:: python | ||
|
||
df2 = pd.DataFrame({'X': ['B', 'B', 'A', 'A'], 'Y': [1, 2, 3, 4]}) | ||
df2 = pd.DataFrame({'X': ['A', 'A', 'B', 'B'], 'Y': [1, 2, 3, 4]}) | ||
df2.groupby(['X']).sum() | ||
df2.groupby(['X'], sort=False).sum() | ||
|
||
|
@@ -703,7 +703,7 @@ code would work even without the special versions via dispatching (see below). | |
Transformation | ||
-------------- | ||
|
||
The ``transform`` method returns an object that is indexed the same (same size) | ||
The ``transform`` method returns an object that is indexed with the same size | ||
as the one being grouped. The transform function must: | ||
|
||
* Return a result that is either the same size as the group chunk or | ||
|
@@ -799,7 +799,7 @@ Another common data transform is to replace missing data with the group mean. | |
transformed = grouped.transform(lambda x: x.fillna(x.mean())) | ||
|
||
We can verify that the group means have not changed in the transformed data | ||
and that the transformed data contains no NAs. | ||
and that the transformed data contains no NAN's. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We try to use NA to refer to missing values in generally. We'll sometimes use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, got it! |
||
|
||
.. ipython:: python | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was deliberate. We want the
X
column to be unsorted so that the two operations below (sort=True/False
) are differentiations.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now reading it more carefully I can see the intention of this section. I will pay more attention when proposing small changes similar to that one, sorry.