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: 2-Working-With-Data/07-python/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,7 +173,7 @@ df.iloc[:5]
173
173
174
174
**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`:
175
175
```python
176
-
df.groupby(by='LenB').mean()
176
+
df.groupby(by='LenB').[['A','DivA']]mean()
177
177
```
178
178
If we need to compute mean and the number of elements in the group, then we can use more complex `aggregate` function:
0 commit comments