-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Description
Per Chris Billington on pystatsmodels
In [8]: df
Out[8]:
a b c routine1 routine2 top
result1 result2 result1 OD
wx wy
0 -0.914239 -0.230830 -0.421134 0.131751 -0.902347 0.382893 0.334615 0.909842
1 -0.533285 -0.878316 -3.046224 -0.760047 0.299502 -0.268321 -0.709366 -0.878868
2 0.804353 -1.203268 -1.221442 -1.948503 0.156240 -0.439375 -0.921254 1.119102
In [9]: df2 = df.set_index([('a','','')])
In [10]: df2
Out[10]:
<class 'pandas.core.frame.DataFrame'>
Index: 3 entries, -0.914238702285 to 0.804353019197
Data columns:
('b', '', '') 3 non-null values
('c', '', '') 3 non-null values
('routine1', 'result1', '') 3 non-null values
('routine1', 'result2', '') 3 non-null values
('routine2', 'result1', '') 3 non-null values
('top', 'OD', 'wx') 3 non-null values
('top', 'OD', 'wy') 3 non-null values
dtypes: float64(7)
In [11]: df2.columns
Out[11]:
Index([('b', '', ''), ('c', '', ''), ('routine1', 'result1', ''),
('routine1', 'result2', ''), ('routine2', 'result1', ''),
('top', 'OD', 'wx'), ('top', 'OD', 'wy')], dtype=object)