I know that I can get the unique values of a DataFrame by resetting the index but is there a way to avoid this step and get the unique values directly?
Given I have:
C
A B
0 one 3
1 one 2
2 two 1
I can do:
df = df.reset_index()
uniq_b = df.B.unique()
df = df.set_index(['A','B'])
Is there a way built in pandas to do this?