text: Q:
  
  Normalizing list of list python
  
  I have a list of list like this:
  > x =[[87.46853791525385, 0.28074670571010246], [126.11314768167513, 0.3977334471784522],[122.58453149726517, 0.4361537416813799],[83.34642493277082, 0.3468989093276901],  [99.20805518615764, 0.2667645066606457],...]
  
  The first position of each inner list represents one variable, while the second position  position of each inner list represents another variable.
  I would like to normalize each variable using this formula:
  m_s = ( m0 -min(m0) ) / ( max(m0) - min(m0) )
  Where the m_s is the scaled value of the parameter, m_o is the actual value of the parameter. Min is the minimum variable of one variable and max is the max variable.
  
  A:
  
  If I understand your question right, you want to apply the scaling function to every variable in the list x:
  x = [[87.46853791525385, 0.28074670571010246], [126.11314768167513, 0.3977334471784522],[122.58453149726517, 0.4361537416813799],[83.34642493277082, 0.3468989093276901],  [99.20805518615764, 0.2667645066606457]]
  
  min_var1 = min(val for (val, _) in x)
  max_var1 = max(val for (val, _) in x)
  
  min_var2 = min(val for (_, val) in x)
  max_var2 = max(val for (_, val) in x)
  
  # m_s = ( m0 -min(m0) ) / ( max(m0) - min(m0) )
  func = lambda x, min_x, max_x: (x - min_x) / (max_x - min_x)
  
  x = [[func(var1, min_var1, max_var1), func(var2, min_var2, max_var2)] for var1, var2 in x]
  
  from pprint import pprint
  pprint(x)
  
  Prints:
  [[0.09638599166658474, 0.08254479127758767],
   [1.0, 0.773183375565603],
   [0.9174915458187556, 1.0],
   [0.0, 0.473078484929904],
   [0.37088720467347935, 0.0]]
  
  