I have the following DataFrame:
df = pd.DataFrame({
'Trader': 'Carl Mark Carl Joe Joe Carl Joe Carl'.split(),
'Product': list('AAAABBAA'),
'Quantity': [5,2,5,10,1,5,2,3],
'Start' : [
DT.datetime(2013,1,1,9,0),
DT.datetime(2013,1,1,8,5),
DT.datetime(2013,2,5,14,0),
DT.datetime(2013,2,5,16,0),
DT.datetime(2013,2,8,20,0),
DT.datetime(2013,2,8,16,50),
DT.datetime(2013,2,8,7,0),
DT.datetime(2013,7,4,8,0)]})
When I try to put the index via:
df = df.set_index([df.Start, df.Trader, df.Product])
It does not delete the columns which are used for the index. Even when I specify it explicitly using:
df = df.set_index([df.Start, df.Trader, df.Product], drop=True)
Is this a bug or do I have a mistake in my code?
Thanks
Andy