Jeopardy, Step 3

Hi,

Step 3 of the Jeopardy project states: Write a function that filters the dataset for questions that contains all of the words in a list of words. For example, when the list [“King”, “England”] was passed to our function, the function returned a DataFrame of 152 rows.

I managed to find the correct amount of rows where values matched the list of words passed to my function, however the only way I managed to count how many rows in the df column was by using a counter in the for loop.

Could someone suggest a better way of storing the values from each row and then counting those rows?

I tried appending to an empty list, but it wouldn’t allow me to do it.

Thanks

I’m trying to do this same step, and I’m having a hard time finding what articles to read back over to try to figure it out. I want to iterate through the rows of the dataframe and return the entire row where the question contains all the words in the list.

The solution above is closer than I have been able to get, but it doesn’t filter to show the entire row.