Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions learntools/sql/ex5.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def check(self, results):
assert (len(results) == len(rides_per_year_answer)), ("The results don't look right. Try again.")
# check 3: one value in particular
year_to_check = list(rides_per_year_answer["year"])[-1]
correct_number = int(rides_per_year_answer.loc[rides_per_year_answer["year"]==year_to_check]["num_trips"].values)
submitted_number = int(results.loc[results["year"]==year_to_check]["num_trips"].values)
correct_number = rides_per_year_answer.loc[rides_per_year_answer["year"]==year_to_check]["num_trips"].values[0]
submitted_number = results.loc[results["year"]==year_to_check]["num_trips"].values[0]
assert (correct_number == submitted_number), ("The results don't look right. Try again.")

_hint = "Start your query with `SELECT EXTRACT(YEAR FROM trip_start_timestamp) AS year, COUNT(1) AS num_trips`."
Expand Down