I have a data-frame df1 that looks like:
col2 col3
date dept
2020-05-07 A 29 21
2020-05-08 B 56 12
2020-05-09 C 82 15
2020-05-10 D 13 9
2020-05-11 E 35 13
2020-05-12 F 53 87
2020-05-13 G 25 9
2020-05-14 H 23 63
the data-frame has two index columns (date and dept). How can I change the data-frame so that it is only indexed by date? So my desired output looks like:
dept col2 col3
date
2020-05-07 A 29 21
2020-05-08 B 56 12
2020-05-09 C 82 15
2020-05-10 D 13 9
2020-05-11 E 35 13
2020-05-12 F 53 87
2020-05-13 G 25 9
2020-05-14 H 23 63
I have tried to use:
df1 = df1.reset_index('date')
without success.