79135055

Date: 2024-10-28 20:49:35
Score: 1
Natty:
Report link

The datatype is incompatible with the numpy function you are calling, but can you cast the datatype to float and then try rounding?

I have some python code that labels distances on an image and do the decimal rounding with text = f"{data_list[i]:0,.3f}" where data_list is a list of floats.

import numpy as np
# convert to float
arr.astype(np.float32)
K=3
rounded=np.round(arr,K)
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Haley Schuhl