0

I am new to Python.I have created a small dictionary with the name Features.It has three keys in it.

print features.keys()
['Amy', 'LadyJesusFan777', 'rach']

I have written a small code below where get_count function returns a dictionary .I want three different dictionary with the name 'Amy' , 'LadyJesusFan777' , 'rach' mapped to the dictionary returned by the get_count function.But unfortunately my below code is returning only one dictionary with the name key.

for key in features.keys(): 
 key = get_count(features[key])

Code for get_count function.

def get_count(doc):

 pair1 = collections.Counter(doc)
 print pair1.keys()
 print pair1.values()

 return pair1

Please help me out.?

rombi
  • 199
  • 3
  • 22
  • Show `features`, and where do you want to store those dictionaries? In other words, full input and full expected output. – luk32 Mar 25 '15 at 15:56
  • In addition to what luk32 requested, what's the functionality of get_count? i.e. expected input and expected output? – Sid Mar 25 '15 at 16:25
  • @Sid Get_count function outputs a dictionary.I want that dictionary to be named 'Amy'in first iteration,'LadyJesusFan777' in second iteration and so on i.e the name of keys of the feature dictionary. – rombi Mar 25 '15 at 16:35

0 Answers0