def order_salaries(df):
    """Turn salary range into ordered variable."""
    df = df.copy()
    cats = ['< 10k', '10k to 20k', '20k to 30k',
            '30k to 40k', '40k to 50k', '50k to 60k',
            '60k to 70k', '70k to 80k', '> 80k']
    df['salary_range'] = (df.salary_range.cat
                          .set_categories(cats, ordered=True))
    return df