Categories
pandas python

Parse pandas (multi)index to datetime

I have multi-index df as follows

                x  y
id date
abc 3/1/1994 100 7
9/1/1994 90 8
3/1/1995 80 9

Where dates are stored as str.

I want to parse date index. The following statement

df.index.levels[1] = pd.to_datetime(df.index.levels[1])

returns error:

TypeError: 'FrozenList' does not support mutable operations.