How to extract location form twitter user locations?

275 Views Asked by At

I'm using python tweepy package to extract covid-19 related tweets, and I need to pre-process the data, as you can see in the picture the user_location is not clear, I need to extract countries form this so there would be a column that indicates the country like India, United States, France, etc. Here is my Data I'm using the code on this page to get the data https://github.com/gabrielpreda/covid-19-tweets/blob/master/covid-19-tweets.ipynb

since the data is really diverse and patternless, one solution could be checking form a database or such thing to map attributes to a country but it would not work for all the cases and it would have a significant computational cost

0

There are 0 best solutions below