0

This is the dataset that I am attempting to use:

https://storage.googleapis.com/hewwo/NCHS_-_Leading_Causes_of_Death__United_States.csv

I am wondering how I can specifically drop rows that contain certain values. In this example, many rows from the "Cause Name" column have values of "All causes". I want to drop any row that has this value for that column. This is what I have tried so far:

death2[death2['cause_name' ]!= 'All Causes']

While this did not give me any errors, it also did not seem to do anything to my dataset. Rows with "All causes" were still present. Am I doing something wrong?

Calvin
  • 19
  • 1
  • 1
  • 5

1 Answers1

0

No changes were made to your DataFrame. You need to reassign it if you want to change it.

death2 = death2[death2['cause_name' ]!= 'All Causes']
Nicolas Gervais
  • 33,817
  • 13
  • 115
  • 143