The next data we will look at is the trips on each day of the week
count_day_2022 = [0 for i in range(7)] count_day_2010 = [0 for i in range(7)]
in this count list, the index 0 corresponds to Sunday and 6 corresponds to Saturday, other days of the week in between
the value in the list is the number of trips taken on the corresponding day of the week
ex. if there were only 6 trips taken on Monday (index = 1) then count_day_2022 = [0, 6, 0, 0, 0, 0, 0]
#2022
for date in df_2022['start day']:
#loops through all of the dates in the start day column of the data
day = datetime.datetime.strptime(date, "%d/%m/%Y")
#takes the date string from the data and converts it to a Python datetime format
index = int(day.strftime("%w"))
#finds the day of the week from the date as a number 0 to 6 just like the count_day array, assigns it to a variable called index
#Write a line of code that takes the index and increments the count_day_2022 array