Download core/utils.py from Surajnitp/flowmarg: direct link, hf CLI and curl.
- Browser
- Download file 399 Bytes
-
https://huggingface.co/spaces/Surajnitp/flowmarg/resolve/main/core/utils.py
- Command line
-
hf download hf://spaces/Surajnitp/flowmarg/core/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/Surajnitp/flowmarg/resolve/main/core/utils.py
399 Bytes
| 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 | |