Skip to content

Commit a36ac76

Browse files
committed
debugged the (Working With Data expression error)
I debugged the grouping in pandas error
1 parent 0d75f30 commit a36ac76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ df.iloc[:5]
173173

174174
**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`:
175175
```python
176-
df.groupby(by='LenB').mean()
176+
df.groupby(by='LenB').[['A','DivA']]mean()
177177
```
178178
If we need to compute mean and the number of elements in the group, then we can use more complex `aggregate` function:
179179
```python

0 commit comments

Comments
 (0)