python - How can I use list comprehension in following scenario? -
for key in enron_data.keys(): if(enron_data[key]['email_address'] != 'nan'): count += 1 print count
enron_data 2d dictionary, containing names & value,key pairs
can use len(..)
len( [v v in enron_data.values() if v['email_address'] != 'nan'] )
Comments
Post a Comment