code: function averageValues(categorical, numeric) {
    const sumMap = {};
    const [uniques, counts] = uniqueValues(categorical);
    for (let i = 0; i < uniques.length; ++i) {
      sumMap[uniques[i]] = {
        sum: 0,
        count: counts[i],
      };
    }
    for (let j = 0; j < numeric.length; ++j) {
      sumMap[categorical[j]].sum += parseFloat(numeric[j]);
    }
    const u = [];
    const a = [];
    Object.keys(sumMap).forEach((uniqueKey) => {
      u.push(uniqueKey);
      a.push(sumMap[uniqueKey].sum / sumMap[uniqueKey].count);
    });
    return [u, a];
  }
docs: /*
  Given two parallel arrays, one categorical, one numeric, return two new arrays.
  The first returned array contains the unique values from the categorical input,
  while the second returned array contains averages from the numeric input
  over each category.