I am trying to append the prediction column from df_B
to df_A
.
df_A['prediction'] = df_B['prediction']
But the column wasn't properly copied and I got the following error:
/Users/edamame/workspace/git/tensorplay/venv/lib/python3.7/site-packages/ipykernel_launcher.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
"""Entry point for launching an IPython kernel.
Is there a way to properly perform the column copy without looping over the data frame?