This article is part of a series of practical guides for using the Python data processing library pandas. To see view all the available parts, click here.
For many users starting out with pandas, a common and frustrating warning that pops up sooner or later is the following:
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
To the uninitiated, it can be hard to know what it means or if it even matters. In this guide, we’ll walk through what the warning means, why you are seeing it, and what you can do to avoid it.
Continue reading