mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
24 lines
587 B
Python
24 lines
587 B
Python
import pandas as pd
|
|
from tqdm import tqdm
|
|
from backend.address2UPRN.main import get_uprn
|
|
|
|
# Enable tqdm for pandas
|
|
tqdm.pandas()
|
|
|
|
df = pd.read_excel("address2.xlsx")
|
|
|
|
|
|
def extract_uprn(row):
|
|
print(row["User Input"], row["Postcode"])
|
|
result = get_uprn(row["User Input"], row["Postcode"], return_address=True)
|
|
|
|
if result is None:
|
|
return pd.Series([None, None])
|
|
|
|
uprn, found_address = result
|
|
return pd.Series([uprn, found_address])
|
|
|
|
|
|
df[["juntes uprn", "junte found address"]] = df.progress_apply(extract_uprn, axis=1)
|
|
|
|
df.to_excel("outputs2.xlsx", index=False)
|