Update 2-Working-With-Data/07-python/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/548/head
Lee Stott 3 months ago committed by GitHub
parent a36ac76843
commit f1ad5fb303
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -173,7 +173,7 @@ df.iloc[:5]
**Grouping** is often used to get a result similar to *pivot tables* in Excel. Suppose that we want to compute mean value of column `A` for each given number of `LenB`. Then we can group our DataFrame by `LenB`, and call `mean`: **Grouping** is often used to get a result similar to *pivot tables* in Excel. Suppose that we want to compute mean value of column `A` for each given number of `LenB`. Then we can group our DataFrame by `LenB`, and call `mean`:
```python ```python
df.groupby(by='LenB').[['A','DivA']]mean() df.groupby(by='LenB')[['A','DivA']].mean()
``` ```
If we need to compute mean and the number of elements in the group, then we can use more complex `aggregate` function: If we need to compute mean and the number of elements in the group, then we can use more complex `aggregate` function:
```python ```python

Loading…
Cancel
Save