Below is a (1,3) array that represents the world coordinates of detected car's Centroid:
World_Point=[[3.27996023 0.29204794 1. ]]
How can I turn the float numbers into the format shown below?
World_Point=[[3.27 0.29 1]]
Below is a (1,3) array that represents the world coordinates of detected car's Centroid:
World_Point=[[3.27996023 0.29204794 1. ]]
How can I turn the float numbers into the format shown below?
World_Point=[[3.27 0.29 1]]
do this for two decimal points :
result = (round(Wprld_Point, 2))
or as for list
for x in World_Point:
(round(x, 2))
World_Point=[[3.27996023, 0.29204794, 1.0 ]]
def myround(numbers):
return [round(x,2) for x in numbers]
World_Point = list(map(myround, World_Point))
print(World_Point)