Reputation: 549
My initial Dataframe like this with index 'trade_dt':
stcode closePrice
trade_dt
2011-02-28 601179.SH 8.5600
2011-02-28 600736.SH 157.9124
2011-02-28 600243.SH 18.0842
2011-03-31 002437.SZ 70.8500
2011-03-31 601988.SH 3.6790
and when I using groupby() it generate a new index like this:
stcode closePrice
trade_dt trade_dt
2011-02-28 2011-02-28 601179.SH 8.5600
2011-02-28 600736.SH 157.9124
2011-02-28 600243.SH 18.0842
2011-03-31 2011-03-31 002437.SZ 70.8500
2011-03-31 601988.SH 3.6790
How can I delete the new index in the bottom Dataframe?Thanks!
Upvotes: 0
Views: 34
Reputation: 323396
You can using reset_index
with drop = True
Yourdf=Yourdf.reset_index(level=0,drop=True)
Upvotes: 2