Parse User name for extracting user location Twitter

后端 未结 1 400
南旧
南旧 2021-01-29 15:32

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         


        
1条回答
  •  情歌与酒
    2021-01-29 15:58

    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.

    0 讨论(0)
提交回复
热议问题