Skip to main content
3 of 6
added 212 characters in body
Punnerud
  • 8.2k
  • 2
  • 58
  • 47

In newer version of Pandas, inspired by the documentation: https://pandas.pydata.org/docs/user_guide/10min.html#viewing-data

pd[pd["colume_name"] == some_value] #Scalar, True/False.. pd[pd["colume_name"] == "some_value"] #String 

Combine multiple conditions by putting the clause in brackets () and combining them with & and | (and/or). Like this:

pd[(pd["colume_name"] == "some_value1") & (pd[pd["colume_name"] == "some_value2"])] 
Punnerud
  • 8.2k
  • 2
  • 58
  • 47