Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. my_dict = default(dict, {"K": {"k": 2, "x": 1.0}, "S": {"_":1.0, "s":1}, "EH": {"e":1.0}})
  2.  
  3. defaultdict(<class 'dict'>, {'EH': {'e': 1.0}, 'K': {'k': 0.6666666666666666, 'x': 0.3333333333333333}, 'S': {'_': 0.5, 's': 0.5}})
  4.  
  5. from collections import defaultdict
  6.  
  7. my_dict = default(dict, {"K": {"k": 2, "x": 1.0}, "S": {"_":1.0, "s":1}, "EH": {"e":1.0}})
  8.  
  9. def dict_probability(my_dict):
  10.  
  11. return_dict = defaultdict(dict)
  12.  
  13. for key, value in my_dict.items():
  14. for k, v in values.items():
  15.  
  16. dict_two = defaultdict(dict, {('EH', 't'): {'e': 2}, ('N', 'e'): {'ne': 1, 'n': 2}})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement