bikeshare.py
def time_stats(fdf):
    """Displays statistics on the most frequent times of travel."""

    print('\nCalculating The Most Frequent Times of Travel...\n')
    start_time = time.time()
    # display the most common month
    mcm =fdf['month'].mode()[0] #most common month as an integer
    month_position = months_val_list.index(mcm) #month's position
    most_common_month = months_key_list[month_position].capitalize() #month's name
    print("The most common month for travel is: " + most_common_month)
    # display the most common day of week
    mcd = fdf['day'].mode()[0] #most common day as an integer
    day_position = days_val_list.index(mcd) #day's position
    most_common_day = days_key_list[day_position].capitalize() #day's name
    print("The most common day for travel is: " + most_common_day)
    # display the most common start hour
    most_common_hour = fdf['hour'].mode()[0] #most common hour as integer
    print("The most common hour for travel is: " + str(most_common_hour) + ":00")

    print("\nThis took %s seconds." % (time.time() - start_time))
    print('-'*40)
Displays statistics on the most frequent times of travel.
Displays statistics on the most frequent times of travel.
Displays statistics on the most frequent times of travel .
def time_stats(fdf):
    print('\nCalculating The Most Frequent Times of Travel...\n')
    start_time = time.time()
    mcm =fdf['month'].mode()[0] 
    month_position = months_val_list.index(mcm) 
    most_common_month = months_key_list[month_position].capitalize() 
    print("The most common month for travel is: " + most_common_month)
    mcd = fdf['day'].mode()[0] 
    day_position = days_val_list.index(mcd) 
    most_common_day = days_key_list[day_position].capitalize() 
    print("The most common day for travel is: " + most_common_day)
    most_common_hour = fdf['hour'].mode()[0] 
    print("The most common hour for travel is: " + str(most_common_hour) + ":00")
    print("\nThis took %s seconds." % (time.time() - start_time))
    print('-'*40)
def time_stats ( fdf ) : print ( '\nCalculating The Most Frequent Times of Travel...\n' ) start_time = time . time ( ) mcm = fdf [ 'month' ] . mode ( ) [ 0 ] month_position = months_val_list . index ( mcm ) most_common_month = months_key_list [ month_position ] . capitalize ( ) print ( "The most common month for travel is: " + most_common_month ) mcd = fdf [ 'day' ] . mode ( ) [ 0 ] day_position = days_val_list . index ( mcd ) most_common_day = days_key_list [ day_position ] . capitalize ( ) print ( "The most common day for travel is: " + most_common_day ) most_common_hour = fdf [ 'hour' ] . mode ( ) [ 0 ] print ( "The most common hour for travel is: " + str ( most_common_hour ) + ":00" ) print ( "\nThis took %s seconds." % ( time . time ( ) - start_time ) ) print ( '-' * 40 )
Displays statistics on the most frequent times of travel.
Displays statistics on the most frequent times of travel .
"""Displays statistics on the most frequent times of travel.""" # display the most common month
 #most common month as an integer
 #month's position
 #month's name
 # display the most common day of week
 #most common day as an integer
 #day's position
 #day's name
 # display the most common start hour
 #most common hour as integer

fdf