mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-30 13:10:56 +00:00
some nice formatting to ensure there is only one installer
This commit is contained in:
parent
cc07706fc1
commit
94f7ca3ab6
1 changed files with 12 additions and 2 deletions
|
|
@ -152,6 +152,7 @@ class SurveyPrice():
|
|||
if self.all_hubspot_submissions is None:
|
||||
raise RuntimeError("No information found from Hubspot")
|
||||
|
||||
# Standardise address
|
||||
self.all_survey_info_from_sharepoint['clean_address'] = self.all_survey_info_from_sharepoint['SHAREPOINT ADDRESS'].apply(
|
||||
lambda x: x.lower().replace(',', '').strip()
|
||||
)
|
||||
|
|
@ -160,11 +161,20 @@ class SurveyPrice():
|
|||
lambda x: x.lower().replace(',', '').strip()
|
||||
)
|
||||
|
||||
# re-name to installer
|
||||
self.all_survey_info_from_sharepoint = self.all_survey_info_from_sharepoint.rename(
|
||||
columns={'SHAREPOINT INSTALLER': 'INSTALLER'}
|
||||
)
|
||||
|
||||
self.all_hubspot_submissions = self.all_hubspot_submissions.rename(
|
||||
columns={'HUBSPOT_INSTALLER': 'INSTALLER'}
|
||||
)
|
||||
|
||||
merged_df = pd.merge(
|
||||
self.all_survey_info_from_sharepoint,
|
||||
self.all_hubspot_submissions,
|
||||
left_on=['clean_address', 'SHAREPOINT INSTALLER'],
|
||||
right_on=['clean_address', 'HUBSPOT_INSTALLER'],
|
||||
left_on=['clean_address', 'INSTALLER'],
|
||||
right_on=['clean_address', 'INSTALLER'],
|
||||
how='inner'
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue