May-15-2018, 06:10 PM
(This post was last modified: May-15-2018, 06:13 PM by Jack_Sparrow.)
I did:
Error Message: Unexpected indent
ok I got it. Thank you!
df['month'] = df['Start Time'].dt.month df['day_of_week'] = df['Start Time'].dt.weekday_name if weekday !='all': # filter by day of week to create the new dataframe df = df[df['day_of_week'] == weekday.title()] # filter by month if applicable if month != 'all': # use the index of the months list to get the corresponding int months = ['January', 'February', 'March', 'April', 'May', 'June'] month = months.index(month) + 1now I have an error here: if weekday !='all':
Error Message: Unexpected indent
ok I got it. Thank you!