Given this MultiIndex Dataframe:
arrays = [np.array(['A', 'A', 'B', 'B', 'C', 'C']),
np.array(['one', 'two', 'one', 'two', 'one', 'two'])]
df = pd.DataFrame(np.random.randn(6), index=arrays, columns=['col1'])
I would like to add a new row (inner index) to every row in the outer index.
df.loc[(slice(None),'three'),:] = {'A':3, 'B':4, 'C':5}
However this gives me an error: KeyError: 'three'
How can I accomplish this?
EDIT: All values in the row are not the same.