I'm trying to create a nested dictionary with the following format:
{person1:
{tweet1 that person1 wrote: times that tweet was retweeted},
{tweet2 that person1 wrote: times that tweet was retweeted},
person2:
{tweet1 that person2 wrote: times that tweet was retweeted},...
}
I'm trying to create it from the following data structures. The following are truncated versions of the real ones.
rt_sources =[u'SaleskyKATU', u'johnfaye', u'@anisabartes']
retweets = [[],
[u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT',u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT', u'Stay safe #nyc #sandy http://t.co/TisObxxT'], []]
annotated_retweets = {u'Stay safe #nyc #sandy http://t.co/TisObxxT':26}
'''
Key is a tweet from set(retweets)
Value is how frequency of each key in retweets
'''
for_Nick = {person:dict(tweet_record,[annotated_tweets[tr] for tr in tweet_record])
for person,tweet_record in zip(rt_sources,retweets)}
Neither this SO question nor this one seem to apply.