Closed cclauss closed 7 years ago
I don't know why but I'm getting this error (python2). I'm trying to figure out why right now
Traceback (most recent call last):
File "tweets_analyzer.py", line 303, in <module>
main()
File "tweets_analyzer.py", line 269, in main
print_charts(activity_weekly, "Weekly activity distribution (per day)", weekday=True)
File "tweets_analyzer.py", line 211, in print_charts
displayed_key = "%s (\033[92m+\033[0m)" % (int_to_weekday(key) if weekday else key)
File "tweets_analyzer.py", line 182, in int_to_weekday
return weekdays[day % len(weekdays)]
TypeError: not all arguments converted during string formatting
Ok got it, had to add int(), day is a string
return weekdays[int(day) % len(weekdays)]
I thought about the ìnt()` thing on the metro this morning. Good that you caught it. You have a cool tool here...
https://docs.python.org/2/library/collections.html#collections.Counter