pandas_groupby
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
pandas_groupby [2021/07/06 23:02] – [preserve the highest odd value in each group] admin | pandas_groupby [2021/07/06 23:07] – [preserve the highest odd value in each group] admin | ||
---|---|---|---|
Line 93: | Line 93: | ||
11 MM7 S7 | 11 MM7 S7 | ||
</ | </ | ||
- | get all the rows with highest odd ' | + | |
+ | We want | ||
< | < | ||
| | ||
Line 103: | Line 104: | ||
11 MM7 S7 | 11 MM7 S7 | ||
</ | </ | ||
+ | That is get all the rows with highest odd ' | ||
+ | If there is a group with only even ' | ||
+ | |||
Solution | Solution | ||
< | < | ||
Line 169: | Line 173: | ||
In [5]: | In [5]: | ||
- | df.groupby([' | + | idx = df.groupby([' |
+ | idx | ||
Out[5]: | Out[5]: | ||
0 False | 0 False |
pandas_groupby.txt · Last modified: 2024/05/07 20:47 by raju