ocw/utils.py
def trim_dataset(dataset):
    ''' Trim datasets such that first and last year of data have all 12 months

    :param dataset: Dataset object
    :type dataset: :class:`dataset.Dataset`

    :returns: Slice index for trimmed dataset
    '''
    start_time, end_time = dataset.temporal_boundaries()
    start_month = 13 if start_time.month == 1 else start_time.month
    end_month = 0 if end_time.month == 12 else end_time.month
    slc = slice(13 - start_month, len(dataset.times) - end_month)
    return slc
 Trim datasets such that first and last year of data have all 12 months

    :param dataset: Dataset object
    :type dataset: :class:`dataset.Dataset`

    :returns: Slice index for trimmed dataset
    
Trim datasets such that first and last year of data have all 12 months
Trim datasets such that first and last year of data have all 12 months
def trim_dataset(dataset):
    start_time, end_time = dataset.temporal_boundaries()
    start_month = 13 if start_time.month == 1 else start_time.month
    end_month = 0 if end_time.month == 12 else end_time.month
    slc = slice(13 - start_month, len(dataset.times) - end_month)
    return slc
def trim_dataset ( dataset ) : start_time , end_time = dataset . temporal_boundaries ( ) start_month = 13 if start_time . month == 1 else start_time . month end_month = 0 if end_time . month == 12 else end_time . month slc = slice ( 13 - start_month , len ( dataset . times ) - end_month ) return slc
Trim datasets such that first and last year of data have all 12 months
Trim datasets such that first and last year of data have all 12 months
''' Trim datasets such that first and last year of data have all 12 months

    :param dataset: Dataset object
    :type dataset: :class:`dataset.Dataset`

    :returns: Slice index for trimmed dataset
    '''
Slice index for trimmed dataset
Slice index for trimmed dataset
dataset
None