def _trim(data, endDt):
    """Removes datetime-value pairs >= endDt to the precision of one month."""
    index = 0
    for i, line in enumerate(data):
        if line[0].month == endDt.month and line[0].year == endDt.year:
            index = i
            break
    return data[0:i]
