-
-
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
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
849df38
Updated the comparison with spreadsheets with GroupBy
0xpranjal 24375f5
removed trailing whitespaces
0xpranjal 56fc085
duplicate names removed
0xpranjal 750e9fc
Changed the length same as the label
0xpranjal 063f3c9
linkedin query editor docs and illustrated example
0xpranjal 94caaf7
fixed pre commit error
0xpranjal c1bec5c
Update doc/source/getting_started/comparison/comparison_with_spreadsh…
0xpranjal d3bd0fe
updated docs based on the comments
0xpranjal ac228ca
Merge branch 'master' of https://github.com/Bhard27/pandas
0xpranjal be3b74b
Merge remote-tracking branch 'upstream/master'
0xpranjal 0d64258
small changes
0xpranjal 35de9ca
small changes
0xpranjal 3b7cc6f
small changes
0xpranjal 44a668d
cli errors fixed
0xpranjal 227b85a
cli errors fixed
0xpranjal 3f8c165
support document link changed
0xpranjal 7d1de9e
Merge branch 'pandas-dev:master' into master
0xpranjal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <hhttps://support.microsoft.com/en-us/office/about-power-query-in-excel-7104fbee-9e62-4cb9-a02e-5bfb1a6c536a>`_. | ||
|
||
.. image:: ../../_static/spreadsheets/group-by.png | ||
|
||
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 | ||
-------------------- | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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 comment
The 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 comment
The 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 comment
The 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?