Code Sample, a copy-pastable example if possible

import pandas as pd
df = pd.DataFrame(columns=["A", "B", "C"])
df.set_index(["A", "B"], inplace=True)
df.ix[("x", "y"), :] = 0

print(df)
print(df.ix[("x", slice(None)), :])
print(df)
Output
     C
A B   
x y  0
   C
B   
y  0
   C
B   
y  0

Problem description

My understanding is that DataFrame.ix is a read-only operation and should not modify the DataFrame. However, in the example above column A is dropped from the index and thus cannot be use anymore.

Expected Output

The unmodified DataFrame. So the last print yields the same output as the first one.

Output of pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.8.0-46-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: de_DE.UTF-8
LOCALE: de_DE.UTF-8

pandas: 0.19.2
nose: None
pip: 9.0.1
setuptools: 35.0.0
Cython: None
numpy: 1.12.1
scipy: 0.19.0
statsmodels: None
xarray: None
IPython: 5.3.0
sphinx: None
patsy: None
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.1.9
pymysql: None
psycopg2: None
jinja2: None
boto: None
pandas_datareader: None

Comment From: jreback

this is a duplicate of https://github.com/pandas-dev/pandas/issues/13842

yes it shouldn't have side-effects. also note that .ix IS deprecated as of 0.20.0