I have a list with year and day starting from December till February from 2003 to 2005. I want to divide this list into list of lists to hold year day from December to February:
a = ['2003337', '2003345', '2003353', '2003361', '2004001', '2004009', '2004017', '2004025', '2004033', '2004041', '2004049', '2004057', '2004337', '2004345', '2004353', '2004361', '2005001', '2005009', '2005017', '2005025', '2005033', '2005041', '2005049', '2005057']
Output should be like:
b = [['2003337', '2003345', '2003353', '2003361', '2004001', '2004009', '2004017', '2004025', '2004033', '2004041', '2004049', '2004057'] ['2004337', '2004345', '2004353', '2004361', '2005001', '2005009', '2005017', '2005025', '2005033', '2005041', '2005049', '2005057']]
and then loop over each list of lists. I could use even splitting but there is a chance of missing year days. So it would be better not to do evenly split. Any suggestions?
aguaranteed to be in chronological order? Is it guaranteed that all days will be inside December-February or do we have to check for illegal values, i.e.'2004151'?