python - Nested dict comprehension -


in following code,

[{word: score_tweet(tweet) word in tweet} tweet in tweets] 

i getting list of dicts:

[{u'soad': 0.0, u'<3': 0.0}, {u'outros': 0.0, u'acredita': 0.0}] 

i obtain 1 flat dict like:

{u'soad': 0.0, u'<3': 0.0, u'outros': 0.0, u'acredita': 0.0} 

how should change code? note: using python 2.7.

{word: score_tweet(tweet) tweet in tweets word in tweet} 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -