def process_rain_data(traffic_data, rain_data):
    """
    Prepare data to make plots regarding rainfall. Add a column storing rain information to the traffic DataFrame.
    :param DataFrame traffic_data: DataFrame containing traffic data
    :param DataFrame rain_data: DataFrame containing rain data
    :return: Processed Pandas DataFrame
    """
    # Since the rain data is hourly, we have to down sample traffic data to per hour
    df = traffic_data.resample('1H').mean().dropna().copy()
    df['rain'] = rain_data['rain']
    df = df.dropna()  # Drop missed data rows

    def rain_grouper(value):
        """
        Group value into rainfall groups
        :param float value:
        :return: Group number in int
        """
        if value == 0:
            return 0
        elif 0 < value <= 1:
            return 1
        elif 1 < value <= 5:
            return 2
        elif 5 < value <= 10:
            return 3
        elif 10 < value <= 20:
            return 4
        elif value > 20:
            return 5

    df['Rain Level'] = df['rain'].apply(rain_grouper)
    df['hour'] = df.index.hour
    return df