There seem to be plenty of other questions about indexing Pandas DataFrames, but I have not found a way to do the type of changes I want. If I have a DF which looks likes
Value
Index1 Index2
0 1 1.1
1 2 1.2
2 3 2.4
3 1 1.3
4 2 2.2
5 3 3.1
I don't need all of index1 to be unique. I would rather have something like
Value
Index1 Index2
0 1 1.1
0 2 1.2
0 3 2.4
1 1 1.3
1 2 2.2
1 3 3.1
Is there a way to do this? I think the easiest way is to apply a function of dividing by index1 values by 3, but not sure how you apply a function to an index. Perhaps though pandas has it's own methods for redefining index values to have groupings like this which are still unique when you consider both indexes?