code: def lorenz(values, weights = None):
      
      if weights is None:
          weights = ones(len(values))
  
      df = pd.DataFrame({'v': values, 'w': weights})
      df = df.sort_values(by = 'v')
      x = cumsum(df['w'])
      x = x / float(x[-1:])
      y = cumsum(df['v'] * df['w'])
      y = y / float(y[-1:])
  
      return x, y
docs: Computes Lorenz Curve coordinates