code: def calcWeightedAvg(data,weights):
      '''
      Generates a weighted average of simulated data.  The Nth row of data is averaged
      and then weighted by the Nth element of weights in an aggregate average.
  
      Parameters
      ----------
      data : numpy.array
          An array of data with N rows of J floats
      weights : numpy.array
          A length N array of weights for the N rows of data.
  
      Returns
      -------
      weighted_sum : float
          The weighted sum of the data.
      '''
      data_avg = np.mean(data,axis=1)
      weighted_sum = np.dot(data_avg,weights)
      return weighted_suf calcWeightedAvg(data,weights):
      '''
      Generates a weighted average of simulated data.  The Nth row of data is averaged
      and then weighted by the Nth element of weights in an aggregate average.
  
      Parameters
      ----------
      data : numpy.array
          An array of data with N rows of J floats
      weights : numpy.array
          A length N array of weights for the N rows of data.
  
      Returns
      -------
      weighted_sum : float
          The weighted sum of the data.
      '''
      data_avg = np.mean(data,axis=1)
      weighted_sum = np.dot(data_avg,weights)
      return weighted_sum
docs: Generates a weighted average of simulated data.  The Nth row of data is averaged
      and then weighted by the Nth element of weights in an aggregate average.
  
      Parameters
      ----------
      data : numpy.array
          An array of data with N rows of J floats
      weights : numpy.array
          A length N array of weights for the N rows of data.
  
      Returns
      -------
      weighted_sum : float
          The weighted sum of the data.