otp.Operation.float.eq#

eq(other, delta)#

Compare two double values between themselves according to delta relative difference. Calculated as abs(column - other) <= delta.

Parameters
Return type

Operation

Examples

>>> data = otp.Ticks(X=[1, 2.17, 10.31841, 3.141593, 6],
...                  OTHER=[1.01, 2.1, 10.32841, 3.14, 5],
...                  DELTA=[0, 1, 0.1, 0.01, 0.001])
>>> data["X"] = (1 + data["X"] - 1).float.eq(data["OTHER"], data["DELTA"])
>>> data = otp.run(data)
>>> data["X"]
0    0.0
1    1.0
2    1.0
3    1.0
4    0.0
Name: X, dtype: float64

See also

cmp