I am trying to scrape user location with respect to user names from twitter.
Input: The user list has more than 50K User names
AkkiPritam,6.77E+17,12/1
You are using 'data' to define your DataFrame and 'df' for what I think should be the columns of the DataFrame
data = pd.read_csv('user_keyword.csv')
df = ['user_name', 'user_id', 'date', 'keyword']
I assume that the user_keyword.csv file has no header, try adding:
data.columns = df
It will change the column names to the values stored in df. Then later instead of:
username = df['user_name']
Try:
username = data['user_name']
Keep in mind that now username is a whole column so get_user_details(username)
should not be expecting a single string.