mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
15 lines
523 B
Python
15 lines
523 B
Python
import pandas as pd
|
|
|
|
df = pd.read_excel(
|
|
"/Users/khalimconn-kowlessar/Documents/hestia/Customers/Cottons/Cottons Asset List.xlsx"
|
|
)
|
|
|
|
# split up the address on commas. First section is address1, last seciton is postcode
|
|
df["address1"] = df["Property Address"].apply(lambda x: x.split(",")[0].strip())
|
|
df["postcode"] = df["Property Address"].apply(lambda x: x.split(",")[-1].strip())
|
|
|
|
# Re-save
|
|
df.to_excel(
|
|
"/Users/khalimconn-kowlessar/Documents/hestia/Customers/Cottons/Cottons Asset List.xlsx",
|
|
index=False,
|
|
)
|