old_precision = np.get_printoptions()["precision"]
np.set_printoptions(precision)
if python_code:
s = repr(value) + " "
else:
s = str(value) + " "
np.set_printoptions(old_precision)
if not u.is_dimensionless:
After Change
// scalars, so we use this hackish way of turning the scalar first into
// an array, then removing the square brackets from the output
if value.shape == ():
s = np.array_str(np.array([value]), precision=precision)
s = s.replace("[", "").replace("]", "").strip()
else:
if python_code:
s = np.array_repr(value, precision=precision)
else: