code: def weighted_std(values, weights):
      
      average = np.average(values, weights=weights)
      variance = np.average((values-average)**2, weights=weights)
      return np.sqrt(variance)
docs: Calculate standard deviation weighted by errors