Image by 95C from Pixabay

Using Pandas’ .loc and .isin() to Filter for a List of Values in Python

Documentation for using both .isin() and .loc to filter a Pandas Dataframe on a list of values

I use .loc on a daily basis. It’s like using the filter function on a spreadsheet.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store