In [8]:
df.set_index('UserId',inplace=True)
df.head()
Out[8]:
OrderId OrderDate OrderPeriod
UserId
47 262 2009-01-11 2009-01
47 278 2009-01-20 2009-01
47 294 2009-02-03 2009-02
47 301 2009-02-06 2009-02
47 302 2009-02-06 2009-02