Code Sample, a copy-pastable example if possible
dat_train, dat_test = train_test_split(dat, test_size=0.3, random_state=110)
dat_train[features] = dat_train[features].values # SettingWithCopyWarning
dat[features] = dat[features].values # right
dat_train = dat_train.ix[dat_train.index]
dat_train[features] = dat_train[features].values # right !
output of pd.show_versions()
INSTALLED VERSIONS
commit: None python: 3.5.1.final.0 python-bits: 64 OS: Windows OS-release: 7 machine: AMD64 processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel byteorder: little LC_ALL: None LANG: None
pandas: 0.17.1 nose: 1.3.7 pip: 8.0.2 setuptools: 19.6.2 Cython: 0.23.4 numpy: 1.10.4 scipy: 0.17.0 statsmodels: 0.6.1 IPython: 4.0.3 sphinx: 1.3.1 patsy: 0.4.0 dateutil: 2.4.2 pytz: 2015.7 blosc: None bottleneck: 1.0.0 tables: 3.2.2 numexpr: 2.4.6 matplotlib: 1.5.1 openpyxl: 2.3.2 xlrd: 0.9.4 xlwt: 1.0.0 xlsxwriter: 0.8.4 lxml: 3.5.0 bs4: 4.4.1 html5lib: None httplib2: None apiclient: None sqlalchemy: 1.0.11 pymysql: None psycopg2: None Jinja2: 2.8
Comment From: jorisvandenbossche
@syzhjjw It is not really clear what you are reporting here. Is it the problem that there is a SettingWithCopyWarning raised? If so, it is quite possible this is correct to raise in that case.
Can you please provide a reproducible example? And indicate in which line you think there is a bug and what the expected output would be?