I have a dataframe that has column of repeating values/indexes and I want to group it by the 'Name' column but without performing any aggregation to it. I've looked at the Dataframe.groupby()
function but from what I've searched, you are kind of forced to perform an aggregation. I've also tried Dataframe.set_index('Name')
and then do Dataframe.sort_index(inplace = True)
but it for some reason it returns a Nonetype
I feel like it's something obvious but I can't quite figure it out.
This is my dataframe now:
Name Data1 Data2
A .1 1.1
A .2 1.2
A .3 1.3
B .6 1.6
B .7 1.7
B .8 1.8
C 1.0 2.0
C 1.1 2.1
C 1.2 2.2
This is what I want:
Name Data1 Data2
A .1 1.1
.2 1.2
.3 1.3
B .6 1.6
.7 1.7
.8 1.8
C 1.0 2.0
1.1 2.1
1.2 2.2