问题描述
我正在尝试从 twitter 中获取与用户名相关的用户位置.
I am trying to scrape user location with respect to user names from twitter.
输入:用户列表有超过50K个用户名
Input: The user list has more than 50K User names
代码:我想查找地理位置,可能是地理坐标.
Code: I want to find geo location possibly geo coordinates.
错误:无法将用户名解析为程序.
Error: Trouble parsing the usernames into program.
推荐答案
你正在使用'data'来定义你的DataFrame和'df'我认为应该是DataFrame的列
You are using 'data' to define your DataFrame and 'df' for what I think should be the columns of the DataFrame
我假设 user_keyword.csv 文件没有标题,尝试添加:
I assume that the user_keyword.csv file has no header, try adding:
它会将列名更改为存储在 df 中的值.然后稍后代替:
It will change the column names to the values stored in df. Then later instead of:
试试:
请记住,现在用户名是一整列,因此 get_user_details(username)
不应期待单个字符串.
Keep in mind that now username is a whole column so get_user_details(username)
should not be expecting a single string.
这篇关于解析用户名以提取用户位置 Twitter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!