I am getting an error message KeyError: 0.73780000000000001
(this is the value of current radius ... see below) , when I try to use value of radius
as a key in dictionary:
The code looks somehow like this:
for n in range(len(myarray)):
radius = (np.sqrt(x[n]**2 + y[n]**2))
The values of x
and y
are floats with four decimals like eg:
-25.9166 71.0444
I tried to cut the decimals with:
for n in range(len(myarray)):
radius = (int(np.sqrt(x[n]**2 + y[n]**2))*10000)/10000.0
I don't understand why it gives me back this strange value 0.73780000000000001