Hi, I am confused about the behavior of code in mission 137-9.
When I use the following code, I get an empty dataframe:
data['graduation'] = data['graduation'][data['graduation']['Cohort'] == '2006']
data['graduation'] = data['graduation'][data['graduation']['Demographic'] == 'Total Cohort']
print(data['graduation'].head())
however, when I replace my single quotes with double-quotes, I get the correct answer:
data["graduation"] = data["graduation"][data["graduation"]["Cohort"] == "2006"]
data["graduation"] = data["graduation"][data["graduation"]["Demographic"] == "Total Cohort"]
print(data["graduation"].head())
Can someone please explain this behavior? From what I’ve been able to find, these should be interchangeable?