Parse User name for extracting user location Twitter

限于喜欢 提交于 2019-12-02 13:35:24

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!