def METHOD_NAME(x, sigfigs):
    """
    round to a certain number of significant figures
    should work on floats and numpy arrays
    NOTE: This should be vectorizable, but np.round takes only a scalar value
          for number of decimals -- you could vectorize the rest of the computation,
          and then loop for the round, but would that buy anything?
          (or use np.vectorize)
    """
    sigfigs = operator.index(sigfigs)
    x = np.asarray(x, dtype=np.float64)
    x = np.asarray(x)
    shape = x.shape
    result = np.fromiter((_round_sf_float(val, sigfigs) for val in x.flat), dtype=np.float64)
    result.shape = shape
    return result