I've created a function designed to run through a column of Twitter handles pandas dataframe, yet it always seems to hit rate-limiting error after just 14 calls.
Here's the code.
def poll_twitter(dfr):
followers = twitter.get_followers_ids(screen_name = dfr['handle'])
time.sleep(5)
print "looping..."
return len(followers['ids'])
df[datetime.datetime.today()] = df.apply(poll_twitter, axis=1)
Here's the error
TwythonRateLimitError: (u'Twitter API returned a 429 (Too Many Requests), Rate limit exceeded'
The list is only 100 handles so I assumed there would be plenty of calls available.
What's the way of fixing it?