How to test if two floats are identical until a specific digit?
I tried,
aa1 = 0.043403
aa2 = 0.043392
print(int(aa1*1000) == int(aa2*1000))
>> True
I want to follow this way, but my data include NAN value, it cannot convert it to intro anyhow. I also tried math.isclose but it's tricky.
For example, I wanted to keep until 3 digits and applied the math.isclose
aa3 = 0.013041
aa4 = 0.012545
aa6 = 0.012945
print(math.isclose(aa3, aa4, abs_tol = 0.0001))
>>Flase
print(math.isclose(aa3, aa5, abs_tol = 0.0001))
>>True
But I want to get False for both cases.
Any simple idea??