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. Every row had the strings "King" and "England" somewhere in its " Question" .

Note that in this example, we found 152 rows by filtering the entire dataset. You can download the entire dataset at the start or end of this project. The dataset used on Codecademy is only a fraction of the dataset so you won’t find as many rows.

Test your function by printing out the column containing the question of each row of the dataset.

Here I am using
df = pd.read_csv(r"C:\Users\rakumishra\Desktop\jeopardy.csv")
print (df[“Question”])— to retrieve the column “Question”. I dont understand why I am getting error when I am using teh correct syntax. Could you please help

hello mate i am stuck in this question, if you found an answer please share it with me

Post the question . Unable to view your question

There is a space before the Q so use print (df[“ Question”]) instead of print (df[“Question”]). Most of the other columns also have a space before their first letter, it’s better to just print out the column names, copy them straight from the printed output and rename each with .replace().

Please I’ve also been stuck on question 3 for a while now. The code below keeps returning an empty dataframe. Can anyone put me through please.

ret_rows = df[df.question.isin([‘King’, ‘England’])]


Make sure you’ve inspected the column names carefully. I was just struggling with trying to rename them, and I realized that something really was off about the column names like they said… Make sure they’re stripped.