Trailing semicolons
At many places there is a ;
at the end of the line.
It's completely unnecessary in Python and you should remove those.
Appending to arrays
At several places you are appending values to arrays in a strange way, for example:
datedict[val[0]] = datedict[val[0]] + [val[1]];
The common and shorter way to do this is using .append()
:
datedict[val[0]].append(val[1])
Augmented assignment operator +=
Instead of:
l = l + 1
This is shorter and better:
l += 1
Use list comprehensions
Instead of:
datearr = [] for dat in daterange(mindate, today): datearr = datearr + [datedict[dat]]
You can use a list comprehension, a powerful feature of Python:
datearr = [datedict[dat] for dat in daterange(mindate, today)]