I would like to be able to look at two rows that have the same identification number, then compare the number of children for each person and assign the larger number for both people. I was thinking of grouping by (.groupby) ID number, but I am not sure where to go from there. Specifically I am not sure how to check which numchild is larger while also replacing the smaller number with the larger one. For example:
Index ID NumChil
0 2011000070 3
1 2011000070 0
2 2011000074 0
3 2011000074 1
should turn in to:
Index ID NumChil
0 2011000070 3
1 2011000070 3
2 2011000074 1
3 2011000074 1