I have 3 columns: the index of household,the number of members of each family and the number of trips for each person. How I can sort these columns?
Here is an example
Household person trip
1 1 1
1 1 2
1 1 3
1 2 1
1 2 3
1 2 2
2 1 2
2 1 1
2 2 1
2 2 2
So I want the third column to be sorted for each person. As you can see in the first household the trips of the second person need to be sorted and in the second household for the first person
So the output is
Household person trip
1 1 1
1 1 2
1 1 3
1 2 1
1 2 2
1 2 3
2 1 1
2 1 2
2 2 1
2 2 2