Peter Otten wrote:
Hm, if ordered_raster_list is guaranteed to contain one string item for every month the above can be simplified to

months = [
'precip_jan', 'precip_feb', 'precip_mar', 'precip_apr', 'precip_may', 'precip_jun', 'precip_jul', 'precip_aug', 'precip_sep', 'precip_oct', 'precip_nov', 'precip_dec']

start = 2
ordered_raster_list = months[start-1:] + months[:start-1]

Or even:
>
    multi_months = [
        'precip_jan', 'precip_feb', 'precip_mar', 'precip_apr',
        'precip_may', 'precip_jun', 'precip_jul', 'precip_aug',
        'precip_sep', 'precip_oct', 'precip_nov', 'precip_dec'] * 2
    start = 2
    ordered_raster_list = multi_months[start - 1: start + 11]

--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to