Need to perform an operation in a dictionary which has a values as a list of dictionaries
my_dicts = \
{"A": [
{ 'key1 a' : 'value1',
'key2 a' : 'value2'
},
{ 'key1 a' : 'value3',
'key2 a' : 'value4'
}
],
"B": [
{ 'key1 b' : 'value5',
'key2 b' : 'value6'
},
{ 'key1 b' : 'value7',
'key2 b' : 'value8'
}
]
}
How can we peform an operaion on all the values who have "key2" as substring in its key? i.e. operation on value2, value4, value6 and value8. "key2" is a substring of "key2 a", "key2 b"