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