Contribute Media
A thank you to everyone who has made this possible: Read More

How do I avoid a SettingWithCopyWarning in pandas?

Description

If you've been using pandas for a while, you've likely encountered a SettingWithCopyWarning. The proper response is to modify your code appropriately, not to turn off the warning! In this video, I'll show you two common scenarios in which this warning arises, explain why it's occurring, and then demonstrate how to address it.

This is video 27 of 30 in the series, Easier data analysis in Python with pandas. The notebook and datasets shown in the video are available on GitHub.

Improve this page