import pandas as pd
df_run = pd.read_csv('UserEventSummary.csv')
df_run.accountId[0] = 'first-' + str(df_run.accountId[0])
The third line gives me this error:
/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/ipykernel/__main__.py:1: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if __name__ == '__main__':
/home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/indexing.py:194: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
self._setitem_with_indexer(indexer, value)
I've read the documentation on that and have a pretty good understanding of when this happens but not quite sure why I'm getting it here. I don't feel I'm doing anything wrong or dangerous!?
I'm guessing there is a better (more correct) way to do this?