def convert_occupancy_categories(df):
    """
    Converts the SP3 occupancy category ids from integers to words

    Parameters
    ----------
    df: pd dataframe
        inventory of the building inventory

    Returns
    -------
    df: pd dataframe
        same inventory with the occupancy categories defined

    """
    attribute = 'building.occupancy_id'
    sp3_occupancies = ['Commercial Office',
                       'Education',
                       'Education',
                       'Education',
                       'Healthcare',
                       'Hospitality',
                       'Residential',
                       'Research',
                       'Retail',
                       'Warehouse',
                       'Residential']
    for i in range(len(sp3_occupancies)):
        tag = i + 1
        df.loc[df[attribute] == tag, attribute] = sp3_occupancies[i]
        df[attribute] = df[attribute].fillna('Unknown')

    return df