Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python apply function to dictionary values

# credit to Stack Overflow user in source link
# f is a Python - defined function

d2 = {k: f(v) for k, v in d1.items()}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #apply #function #dictionary #values
ADD COMMENT
Topic
Name
2+7 =