mattritchey commited on
Commit
47a8e15
·
1 Parent(s): 91e387f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -54,9 +54,13 @@ def google_address(address):
54
  df['Website'] = df['Link'].apply(extract_website_domain)
55
 
56
  df['Square Footage']=df['Description'].str.extract(r"((\d+) Square Feet|(\d+) sq. ft.|(\d+) sqft|(\d+) Sq. Ft.|(\d+) sq|(\d+(?:,\d+)?) Sq\. Ft\.)")[0]
57
- df['Square Footage']=df['Square Footage'].replace({',':''},regex=True).str.replace(r'\D', '')
 
58
  df['Beds']=df['Description'].replace({'-':' ','total':''},regex=True).str.extract(r"(\d+) bed")
59
- df['Baths']=df['Description'].replace({'-':' ','total':''},regex=True).str.extract(r"(\d+) bath")
 
 
 
60
  df['Year Built']=df['Description'].str.extract(r"built in (\d{4})")
61
 
62
  df_final=df[df['Address'].notnull()]
 
54
  df['Website'] = df['Link'].apply(extract_website_domain)
55
 
56
  df['Square Footage']=df['Description'].str.extract(r"((\d+) Square Feet|(\d+) sq. ft.|(\d+) sqft|(\d+) Sq. Ft.|(\d+) sq|(\d+(?:,\d+)?) Sq\. Ft\.)")[0]
57
+ df['Square Footage']=df['Square Footage'].str.extract(r'([\d.]+)').astype(float)
58
+
59
  df['Beds']=df['Description'].replace({'-':' ','total':''},regex=True).str.extract(r"(\d+) bed")
60
+
61
+ df['Baths']=df['Description'].replace({'-':' ','total':''},regex=True).str.extract(r"((\d+) bath|(\d+(?:\.\d+)?) bath)")[0]
62
+ df['Baths']=df['Baths'].str.extract(r'([\d.]+)').astype(float)
63
+
64
  df['Year Built']=df['Description'].str.extract(r"built in (\d{4})")
65
 
66
  df_final=df[df['Address'].notnull()]