0
df = pd.DataFrame(dict(A=[0,1,2,3], C=["Ghana","Nigeria","Africa","South Africa"]))
df[~df.C.str.contains("Africa")]

I want to delete the row with with only "Africa" without deleting the row with "South Africa"

mozway
  • 194,879
  • 13
  • 39
  • 75

0 Answers0