Skip to content

Instantly share code, notes, and snippets.

  • Save sannykhan3777/ad3641c8e18b18786a950fa0be308e0d to your computer and use it in GitHub Desktop.
Save sannykhan3777/ad3641c8e18b18786a950fa0be308e0d to your computer and use it in GitHub Desktop.
Subsetting data based on a categorical variable often involves using the "or" operator (|) to select rows from multiple categories. This can get tedious when you want all states in one of three different regions, for example. Instead, use the .isin() method, which will allow you to tackle this problem by writing one condition instead of three se…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment