Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
pandas get value not equal to 1

pandas get value not equal to

June 24, 2022 by Anurag batra
df[~df['column_name'].isin(['value_1', 'value_2'])] 

Here is what the above code is Doing:
1. df[‘column_name’] is the column you want to filter on
2. ~ is the NOT operator
3. .isin([‘value_1’, ‘value_2’]) is the list of values you want to filter out

Categories Python Examples
Post navigation
django datetimefield default
check if special character in string python
© MyEduKit - 2022 . All Rights Reserved.