new row not created upon assignment to nonexistent row label in DataFrame with MultiIndex #6699
Labels
Error Reporting
Incorrect or improved errors from pandas
Indexing
Related to indexing on series/frames, not to indexes themselves
MultiIndex
According to the documentation for pandas 0.13+, assigning to a non-existent key via the .ix or .loc operations should create a new row in the DataFrame. Using pandas 0.13.1 with Python 2.7.5, I noticed that this doesn't seem to be the case when the DataFrame has a MultiIndex. To illustrate, consider a DataFrame created as follows:
If
df
isthen running
df.loc[(0, 1), :] = (10, 20.0)
modifiesdf
as follows:However, if one attempts to run
df.loc[(0,3), :] = (10, 20.0)
on the originaldf
, one obtainsIs this behavior expected?
The text was updated successfully, but these errors were encountered: