mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
matching for all of ccs
This commit is contained in:
parent
0331d82f6a
commit
678a4b52d2
1 changed files with 13 additions and 0 deletions
|
|
@ -3316,6 +3316,19 @@ def revised_model():
|
|||
to_filter = filtered["Address"].str.replace(" ,", "").str.split(",").str[0:2].str.join("").apply(
|
||||
lambda x: fuzz.partial_ratio(home["Name"], x) > 93
|
||||
)
|
||||
if to_filter.sum() == 0:
|
||||
# We also some cases where the name of the survey folder is like "Colville Road 7" and the
|
||||
# property name is actually 7 Colville Road, so we try taking the final part of the address,
|
||||
# splitting on space, and adding it to the front
|
||||
def reformat_survey_folder(x):
|
||||
filename = x.split("/")[-1]
|
||||
parts = filename.split(" ")
|
||||
return " ".join(parts[-1:] + parts[:-1])
|
||||
|
||||
to_filter = (
|
||||
filtered["survey_folder"].apply(lambda x: reformat_survey_folder(x)).str.lower() ==
|
||||
home["Name"].lower()
|
||||
)
|
||||
|
||||
if to_filter.sum() == 0:
|
||||
blah
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue