INNER CODE UNIT · Python

load_data

alteryx/open_source_demos · predict-appointment-noshow/utils.py:10

def load_data(path):
    """ After loading the data with pandas, fix some
        column names and make appointment_day the end
        of the day. Then, print some information about
        the dataframe.
    """
    # Data Wrangling
    # After loading the data with pandas, Fix typos in some column names
    # but we change others as well to suit personal preference.
    data = pd.read_csv(path, parse_dates=['AppointmentDay', 'ScheduledDay'])
    data.index = data['AppointmentID']
    data.rename(columns={'Hipertension': 'hypertension',
                         'Handcap': 'handicap',
                         'PatientId': 'patient_id',
                         'AppointmentID': 'appointment_id',
                         'ScheduledDay': 'scheduled_time',
                         'AppointmentDay': 'appointment_day',
                         'Neighbourhood': 'neighborhood',

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…