I was wondering if there is an equivalent way to add a row to a Series or DataFrame with a MultiIndex as there is with a single index, i.e. using .ix or .loc?
I thou
Update since .ix is depreciated:
Today you could do:
# say you have dataframe x
x
Out[78]:
a b time
indA indB
a i 0.0 NaN 2018-09-12
b j 1.0 2.0 2018-10-12
c k 2.0 3.0 2018-11-12
f NaN NaN NaT
d i 5.0 NaN NaT
x.loc[('a','k'),:] = (3.5,6,pd.NaT)
x
Out[80]:
a b time
indA indB
a i 0.0 NaN 2018-09-12
b j 1.0 2.0 2018-10-12
c k 2.0 3.0 2018-11-12
f NaN NaN NaT
d i 5.0 NaN NaT
a k 3.5 6.0 NaT