Skip to main content
3 of 4
deleted 334 characters in body
200_success
  • 144.2k
  • 22
  • 188
  • 473

At many places there is a ; at the end of the line. It's completely unnecessary in Python and you should remove those.

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])

Instead of:

l = l + 1

This is shorter and better:

l += 1

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)]
janos
  • 111.7k
  • 15
  • 152
  • 391