File size: 399 Bytes
2379054 | 1 2 3 4 5 6 7 8 9 10 11 12 | import pandas as pd
def point_xy(row):
if row is None: return None
for prefix in ["offset_point","offset_line","center"]:
n = row.get(f"{prefix}_n")
e = row.get(f"{prefix}_e")
if n is not None and e is not None and pd.notna(n) and pd.notna(e):
if not (abs(float(n))<1e-9 and abs(float(e))<1e-9):
return float(n), float(e)
return None
|