@OP If you want to retrieve this info back still in dictionary form (but without updating/overwriting the existing dictionary), you can do it like so based on the code above:
new_d = {key: math.log10(value) for key, value in d.items()}
>>> {'a': 0.0, 'b': 1.0, 'c': 2.0}
• 0 views
•
link