def get_top_n_peaks(peaks_df, n_peaks_to_use):

    """
    Arguments:
        peaks_df: 
            A dataframe. The peak hours for each day.

        n_peaks_to_use: 
            An int. Number of top peaks to use in each season.

    Return:
        A dataframe. The top n_peaks_to_use peaks in each
        season.

    This function keeps the top n_peaks_to_use peak hours in 
    each season.

    """

    # Create a new column to hold rankings in a year
    rankings = peaks_df.groupby(['season']
                                ).adjusted_demand_MW.rank(ascending=False)
    peaks_df['rankings_per_season'] = rankings

    mask = peaks_df['rankings_per_season'] <= float(n_peaks_to_use)
    top_n_peaks = peaks_df[mask]

    return top_n_peaks