home/bikeshare.py
def load_data(city, month, day):
    """
    Loads data for the specified city and filters by month and day if applicable.

    Args:
        (str) city - name of the city to analyze
        (str) month - name of the month to filter by, or "all" to apply no month filter
        (str) day - name of the day of week to filter by, or "all" to apply no day filter
    Returns:
        df - Pandas DataFrame containing city data filtered by month and day
    """    
     # load data file into a dataframe
    df = pd.read_csv(city)

    # convert the Start Time column to datetime
    df['Start Time'] = pd.to_datetime(df['Start Time'])

    # extract month and day of week from Start Time to create new columns
    df['month'] = df['Start Time'].dt.month
    df['day_of_week'] = df['Start Time'].dt.weekday_name

    # 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) + 1

        # filter by month to create the new dataframe
        df = df[df['month'] == month]

    # filter by day of week if applicable
    if day != 'all':
        # filter by day of week to create the new dataframe
        df = df[df['day_of_week'] == day.title()]

    return df

    Loads data for the specified city and filters by month and day if applicable.

    Args:
        (str) city - name of the city to analyze
        (str) month - name of the month to filter by, or "all" to apply no month filter
        (str) day - name of the day of week to filter by, or "all" to apply no day filter
    Returns:
        df - Pandas DataFrame containing city data filtered by month and day
    
Loads data for the specified city and filters by month and day if applicable.
Args:
(str) city - name of the city to analyze
(str) month - name of the month to filter by, or "all" to apply no month filter
(str) day - name of the day of week to filter by, or "all" to apply no day filter
Returns:
df - Pandas DataFrame containing city data filtered by month and day
Loads data for the specified city and filters by month and day if applicable . Args : ( str ) city - name of the city to analyze ( str ) month - name of the month to filter by or " all " to apply no month filter ( str ) day - name of the day of week to filter by or " all " to apply no day filter Returns : df - Pandas DataFrame containing city data filtered by month and day
def load_data(city, month, day):
    df = pd.read_csv(city)
    df['Start Time'] = pd.to_datetime(df['Start Time'])
    df['month'] = df['Start Time'].dt.month
    df['day_of_week'] = df['Start Time'].dt.weekday_name
    if month != 'all':
        months = ['january', 'february', 'march', 'april', 'may', 'june']
        month = months.index(month) + 1
        df = df[df['month'] == month]
    if day != 'all':
        df = df[df['day_of_week'] == day.title()]
    return df
def load_data ( city , month , day ) : df = pd . read_csv ( city ) df [ 'Start Time' ] = pd . to_datetime ( df [ 'Start Time' ] ) df [ 'month' ] = df [ 'Start Time' ] . dt . month df [ 'day_of_week' ] = df [ 'Start Time' ] . dt . weekday_name if month != 'all' : months = [ 'january' , 'february' , 'march' , 'april' , 'may' , 'june' ] month = months . index ( month ) + 1 df = df [ df [ 'month' ] == month ] if day != 'all' : df = df [ df [ 'day_of_week' ] == day . title ( ) ] return df
Loads data for the specified city and filters by month and day if applicable.
Loads data for the specified city and filters by month and day if applicable .
"""
    Loads data for the specified city and filters by month and day if applicable.

    Args:
        (str) city - name of the city to analyze
        (str) month - name of the month to filter by, or "all" to apply no month filter
        (str) day - name of the day of week to filter by, or "all" to apply no day filter
    Returns:
        df - Pandas DataFrame containing city data filtered by month and day
    """ # load data file into a dataframe # convert the Start Time column to datetime # extract month and day of week from Start Time to create new columns # filter by month if applicable # use the index of the months list to get the corresponding int # filter by month to create the new dataframe # filter by day of week if applicable # filter by day of week to create the new dataframe
city
month
day