SettingWithCopyWarning even when using .loc[row_indexer,col_indexer] = value
If you use .loc[row,column] and still get the same error, it’s probably because of copying another data frame. You have to use .copy(). This is a step by step error reproduction: import pandas as pd d = {‘col1’: [1, 2, 3, 4], ‘col2’: [3, 4, 5, 6]} df = pd.DataFrame(data=d) df # col1 col2 #0 … Read more