-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC : Updated the comparison with spreadsheets with GroupBy #39965
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
Changes from 15 commits
849df38
24375f5
56fc085
750e9fc
063f3c9
94caaf7
c1bec5c
d3bd0fe
ac228ca
be3b74b
0d64258
35de9ca
3b7cc6f
44a668d
227b85a
3f8c165
7d1de9e
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 |
---|---|---|
|
@@ -365,6 +365,27 @@ In Excel, there are `merging of tables can be done through a VLOOKUP | |
* It will include all columns from the lookup table, instead of just a single specified column | ||
* It supports :ref:`more complex join operations <merging.join>` | ||
|
||
GroupBy | ||
------- | ||
|
||
In Excel, this can be done by using the `Query Editor <https://support.microsoft.com/en-us/office/introduction-to-the-query-editor-power-query-1d6cdb63-bf70-4ae8-a7d5-6ae9547004d9>`_. | ||
|
||
.. image:: ../../_static/spreadsheets/group-by.png | ||
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. Right now, this section duplicates content from the canonical documentation, which doesn't add any value. I suggest we either:
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. @afeld - are you good here? 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. Reviewing this again, I see that the requested change was not made. I also agree that having an excel example that matches the pandas example would be desirable. 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. @Bhard27 Are you able to update the excel image to match the pandas example below? |
||
|
||
The equivalent in pandas: | ||
We can use :meth:`~DataFrame.groupby`. | ||
For example - | ||
|
||
.. ipython:: python | ||
|
||
df = pd.DataFrame( | ||
{ | ||
'Animal': ['Falcon', 'Falcon', 'Parrot', 'Parrot'], | ||
'Max Speed': [380., 370., 24., 26.], | ||
} | ||
) | ||
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 have an outstanding task in #38990 around standardizing the example datasets used in the page. Totally fine to take care of that as follow-up; just noting. |
||
df | ||
df.groupby(['Animal']).mean() | ||
|
||
Other considerations | ||
-------------------- | ||
|
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.
This page says it will be retired soon, perhaps https://support.microsoft.com/en-us/office/about-power-query-in-excel-7104fbee-9e62-4cb9-a02e-5bfb1a6c536a is better.
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.
Done.