Handling Missing Data Deletion FIX listwise

I’m at the very start of my journey and am a complete newbie. I’m doing the Data Science Foundations and when I got to the Data Types and Quality section, I saw direction by forum comments that I should do the Handling Missing Data course before proceeding. So I went to do that.
But the very first Listwise Deletion exercise on just wouldn’t work. The example says to use
And it doesn’t work.
The next example, for Pairwise deletion says to use
and it also doesn’t work

It kept saying “NameError: name ‘data’ is not defined”

I was getting frustrated as I know NO programming yet and this is all supposed to be beginner friendly. But I had a look online…

I found using “df.dropna” instead of “data.dropna” in both examples makes it work. (“df” = dataframe)

As there doesn’t seem to be a way to flag or report it on that page, I thought I’d post this fix here in case anyone else is facing the same issue!

Handling Missing Data course

I had no idea this course even existed. :joy: :woman_facepalming:

So…I’m wondering if maybe you should come back to this course after you have more of an idea of Pandas and Python in general. (?). Stick with the DS Foundations course and then you can veer off to other courses if you choose. (that’s my .02)

You are correct:

You have to use df. I didn’t write the lesson, but I think that it’s (supposed to be) implied that you’d use df here and not data. But it’s not very clear, as you point out.

Here’s the Pandas docs on that method:

You can report bugs or course suggestions here or here.

Thank you so much. I was stuck and your corrections have done magic.