In the data I am working with the index is compound - i.e. it has both item name and a timestamp, e.g. name@domain.com|2013-05-07 05:52:51 +0200.
name@domain.com|2013-05-07 05:52:51 +0200
I want to
In pandas>=0.16.0, we can use the .str accessor on indices. This makes the following possible:
pandas>=0.16.0
.str
df.index = pd.MultiIndex.from_tuples(df.index.str.split('|').tolist())
(Note: I tried the more intuitive: pd.MultiIndex.from_arrays(df.index.str.split('|')) but for some reason that gives me errors.)
pd.MultiIndex.from_arrays(df.index.str.split('|'))