Pandas drop_duplicates with a tolerance value for duplicates
You can numpy broadcasting:
# Convert to numpy
vals1 = df_test_1.values
vals2 = df_test_2.values

# Remove from df_test_1
arr1 = np.abs(vals1 - vals2[:, None])
msk1 = ~np.any(np.all(arr1 < [100, 100, 0.1], axis=2), axis=1)

# Remove from df_test_2
arr2 = np.abs(vals2 - vals1[:, None])
msk2 = ~np.any(np.all(arr1 < [100, 100, 0.1], axis=2), axis=1)

out = pd.concat([df_test_1[msk1], df_test_2[msk2]], ignore_index=True)

Output:
>>> out
       x      y       z
0  151.0  242.0  124.42
1  633.0  176.0  875.76

Comment of @James

This removes left vs right and right vs left, but not duplicates within left vs left or right vs right.

In this case:
df_test_3 = pd.concat([df_test_1, df_test_2])

arr = df_test_3.values
msk = np.abs(arr - arr[:, None]) < [100, 100, 0.1]
out = df_test_3[np.sum(np.all(msk, axis=2), axis=1) == 1]
print(out)

# Output
       x      y       z
3  151.0  242.0  124.42
3  633.0  176.0  875.76


What I have is two Pandas dataframes of coordinates in xyz-format. One of these contains points that should be masked in the other one, but the values are slightly offset from each other, meaning a direct match with drop_duplicates is not possible. My idea was to round the values to the nearest significant number, but this also does not always work, since if some values are rounded to different numbers, they won't match and won't be removed. For example, if one point lies at x = 149 and another at x = 151, rounding them to the nearest hundred gives different values. My code looks something like this:
import pandas as pd
import numpy as np
df_test_1 = pd.DataFrame(np.array([[123, 449, 756.102], [406, 523, 543.089], [140, 856, 657.24], [151, 242, 124.42]]), columns = ['x', 'y', 'z'])

df_test_2 = pd.DataFrame(np.array([[123, 451, 756.099], [404, 521, 543.090], [139, 859, 657.23], [633, 176, 875.76]]), columns = ['x', 'y', 'z'])

df_test_3 = pd.concat([df_test_1, df_test_2])

df_test_3['xr'] = df_test_3.x.round(-2)
df_test_3['yr'] = df_test_3.y.round(-2)
df_test_3['zr'] = df_test_3.z.round(1)

df_test_3 = df_test_3.drop_duplicates(subset=['xr', 'yr', 'zr'], keep=False)

What I want is to remove duplicates if the columns 'xr' and 'yr' are duplicates +-100 and 'zr' duplicates +-0.1. For example, if two coordinates are rounded to (100, 300, 756.2) and (200, 400, 756.1), they should be considered duplicates and should be removed. Any ideas are appreciated, thanks!
