Is there a way in Pandas to number groups in a DataFrame, based on column values? If my frame looks like this
Column1 Column2 Column3
0 A X 23
1 A X 45
2 A Y 32
3 A Y 53
4 A Y 67
5 B X 85
6 B Y 12
7 B Y 94
What I'd like to be able to do is something like
df.group_numbers(['Column1', 'Column2'])
Column1 Column2 Column3 GroupNumber
0 A X 23 1
1 A X 45 1
2 A Y 32 2
3 A Y 53 2
4 A Y 67 2
5 B X 85 3
6 B Y 12 4
7 B Y 94 4