Input dictionary
d = {'PQR':{"LMN":1.345,'PST':1.278,'BQR':2.345,'RMT':9.867},
'HGE':{'VRM':1.765,'TRM':1.567,'FRM':1.456,'DRM':1.678}}
Is there any way to normalize the nested dictionary values in the range [0,1] using this formula
(value - min(x))/(max(x)- min(x))
However, for normalization, min and max values should find in every inner dictionary. Expected Output
output = {'PQR':{"LMN":0.0078006752823378675,'PST':0.0,'BQR':0.12422866457096288,'RMT':1.0},
'HGE':{'VRM':1.0,'TRM':0.3592233009708738,'FRM':0.0,'DRM':0.7184466019417476}}