mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
14 lines
405 B
Python
14 lines
405 B
Python
from typing import Any
|
|
|
|
import pandas as pd
|
|
|
|
|
|
def pandas_cell_to_str(v: Any) -> str:
|
|
if v is None or (isinstance(v, float) and pd.isna(v)):
|
|
return ""
|
|
s = str(v).replace("\xa0", " ")
|
|
# get_uprn_candidates runs .astype(str) on UPRN, turning NaN into "nan".
|
|
# Treat that as missing so unambiguous_uprn truthiness checks work.
|
|
if s.lower() == "nan":
|
|
return ""
|
|
return s
|