A pretty basic question for you guys:
I've got a list of dates, but there are some duplicates. I'm trying to convert it into a list of two element lists, where element one is the date, and element two is the number of times it appears.
dates is my list of dates, and condensedDates is the new list I'm trying to make.
for i in dates:
a = [i, 0]
if dateCount.count(i) == 1:
a[1] = a[1] + 1
if dateCount.count(i) == 0:
dateCount.append(i)
I'm just stuck for what to do next. Obviously a resets on every for loop. Any suggestions? I'm pretty new to this