Tag Archives: unsupported format string passed to XXX

TypeError: unsupported format string passed to numpy.ndarray.__format__

a_ = np.array([12]).reshape(-1, 1)
a = model.predict(a_)
print("Predicting a 12-inch pizza.{:.2f}".format(a))

Error:
typeerror: unsupported format string passed to numpy.ndarray.format
Pass on to numpy.ndarray .__ format__ Unsupported format string for

solve

a_ = np.array([12]).reshape(-1, 1)
a = model.predict(a_)
print("Predicting a 12-inch pizza.{:.2f}".format(a[0][0]))