Hello everyone!
I am currently working on the Guided Project: Exploring Hacker News Posts. I am getting the error “ValueError: time data ‘9’ does not match format ‘%m/%d/%Y %H:%M’” when I enter the following code:
Do you mind copy/pasting your code here? This will help others be able to run through your code faster - or copy and paste into their own environment! This will also help you get an answer much faster.
Definitely copy/paste the error as well.
Here’s a quick gif on how to format your code as well:
Hi @shaban.k! I copied your code and I believe the error is in how result_list is created. Here is the output from result_list[:4]:
['8/16/2016 9:55', 6, '11/22/2015 13:43', 29]
You are creating a single list where the datetime (row[6]) and number of comments (row[4]) alternate. Then when you try to convert the items in the list, some of the objects are not in the datetime format and it throws up the error.
If you check out step 2 in the instructions on the page, it tells you that result_list will be “a list of lists”. Your output for result_list[4:] should look something like this: