I currently have a data frame of user IDs and the columns inside that data frame have either 1s or 0s which mean the value for that ID at that column is either true or false. It looks something like this:
id north_trip south_trip morning_trip
0 123 1 0 1
1 456 1 0 0
2 123 0 1 1
3 456 1 0 0
4 456 1 0 1
What I'm trying to do is create a new dataframe of Unique ID's from the initial dataframe, and the values instead will be the counter of True (or 1) values that appear for that ID in that column. So the resulting data frame should look like this:
id north_trip south_trip morning_trip
0 123 1 1 2
1 456 3 0 1
Any help or guidance is appreciated! Thanks