Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my_dict = default(dict, {"K": {"k": 2, "x": 1.0}, "S": {"_":1.0, "s":1}, "EH": {"e":1.0}})
- defaultdict(<class 'dict'>, {'EH': {'e': 1.0}, 'K': {'k': 0.6666666666666666, 'x': 0.3333333333333333}, 'S': {'_': 0.5, 's': 0.5}})
- from collections import defaultdict
- my_dict = default(dict, {"K": {"k": 2, "x": 1.0}, "S": {"_":1.0, "s":1}, "EH": {"e":1.0}})
- def dict_probability(my_dict):
- return_dict = defaultdict(dict)
- for key, value in my_dict.items():
- for k, v in values.items():
- dict_two = defaultdict(dict, {('EH', 't'): {'e': 2}, ('N', 'e'): {'ne': 1, 'n': 2}})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement