Last active
August 22, 2019 09:48
-
-
Save onurmatik/d4475e03685d03302c3a3ba4cf369abd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sort the number of retweets from the highest to the lowest | |
rt_counts.sort(reverse=True) | |
# the max number of tweets that has at least been retweeted that number of times | |
r_index = max( | |
[min(i + 1, rt_count) for i, rt_count in enumerate(rt_counts)] | |
) if rt_counts else 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment