code: def measurements_to_bf(measurements: np.ndarray) -> float:
      
      try:
          measurements.sum(axis=0)
      except AttributeError:
          measurements = np.asarray(measurements)
      finally:
          stats = measurements.sum(axis=0) / len(measurements)
  
      stats_str = [str(int(i)) for i in np.round(stats[::-1][1:])]
      bf_str = '0.' + ''.join(stats_str)
      bf = float(bf_str)
  
      return bf
docs: Convert measurements into gradient binary fraction.
  
      :param measurements: Output measurements of gradient program.
      :return: Binary fraction representation of gradient estimate.