I have this bit of code:
visits = defaultdict(int)
for t in tweetsSQL:
visits[t.user.from_user] += 1
I looked at some examples online that used the sorted method like so:
sorted(visits.iteritems, key=operator.itemgetter(1), reverse=True)
but it is giving me:
"TypeError: 'builtin_function_or_method' object is not iterable"
I am not sure why.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With