Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. 714602054988275712,I'm at MK Appartaments in Dobele
  2. 714600471512670212,"Baana bicycle counter.Today: 9 Same time last week: 7 Trend: ↑28% This year: 60 811 Last year: 802 079 #Helsinki #pyöräily #cycling"
  3. 714598616703320065,"Just posted a photo @ Moscow, Russia"
  4. 714593900053180416,We're #hiring! Read about our latest #job opening here: CRM Specialist #lifeinspiringcareers #Moscow #Sales
  5. 714591942949138434,Just posted a photo @ Kfc
  6. 714591380660731904,Homeless guide on my festival of tours from locals for locals #открытаякарта. Shot by Alexandr
  7. 714591338977579009,"Who we are? #edmonton #edm #edmlife #edms #edmlifestyle #edmfamily #edmgirls #edmlov"
  8.  
  9. 714600471512670212,#Helsinki #pyöräily #cycling
  10. 714593900053180416,#hiring! #lifeinspiringcareers #Moscow #Sales
  11. 714591380660731904,#открытаякарта
  12. 714591338977579009,#edmonton #edm #edmlife #edms #edmlifestyle #edmfamily #edmgirls #edmlov"
  13.  
  14. import pandas as pd
  15.  
  16. df1 = pd.read_csv('Turkey_28.csv')
  17.  
  18. key_word = df1[['tweetID', 'tweetText']].set_index('tweetID')['tweetText']
  19.  
  20. key_word = key_word.dropna().apply(lambda x: eval(x))
  21. key_word = key_word[key_word.apply(type) == dict]
  22.  
  23. #I am lost in this section on how to select the hash keywords?
  24. def get_key_words(x):
  25. return pd.Series(x['tweetText'],
  26.  
  27. key_word = key_word.apply(get_key_word)
  28.  
  29. df2 = pd.concat([coords, df1.set_index('tweetID').reindex(coords.index)], axis=1)
  30.  
  31. df2.to_csv('Turkey_key_word.csv', index=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement