0

I have data like this :

    userID  activity   count
0   3       running         5
1   3       running         6
2   3       walking         0
3   3       walking         1
4   3       stopped         2

I want to group data conditionallly, by userID and wether activity is running(1) or not (0)

This will group by userID, of course, I'm a newbie in Pandas!:

numUsers = df.groupby(by=["userID"])["count"].sum()
AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210

0 Answers0