def add_additonal_datetime_variables(df): 
    """Adding variables derived from datetime: dropoff_month, *_week_of_year, *_day_of_year, *_day_of_month, *_weekday, *_is_weekend, *_hour"""
    
    print("adding additonal datetime variables")

    do_dt = df.dropoff_datetime.dt
    as_cat = lambda x: x.astype('category')
    
    df['dropoff_month'] = as_cat(do_dt.month)
    df['drop_off_week_of_year'] = as_cat(do_dt.weekofyear)
    df['dropoff_day_of_year'] = as_cat(do_dt.dayofyear)
    df['dropoff_day_of_month'] = as_cat(do_dt.day)
    df['dropoff_weekday'] = as_cat(do_dt.weekday)
    df['dropoff_is_weekend'] = as_cat(do_dt.weekday > 4)
    df['dropoff_hour'] = as_cat(do_dt.hour)
    
    return df