-
Notifications
You must be signed in to change notification settings - Fork 0
/
buy_box.py
30 lines (27 loc) · 949 Bytes
/
buy_box.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import numpy as np
from qreit.metros.census_tract import get_census_tract
class BuyBox:
def __init__(self, street, city, state, zip_code,
beds, baths, price, year_built, caprate,
pool, power_lines, major_street):
self.street = street
self.city = city
self.state = state
self.zip_code = zip_code
self.beds = beds
self.baths = baths
self.price = price
self.year_built = year_built
self.caprate = caprate
self.pool = pool
self.power_lines = power_lines
self.major_street = major_street
def pull_census_tract(self):
try:
self.census_tract = get_census_tract(self.street, self.city, self.state, self.zip_code)
if self.census_tract:
pass
else:
self.census_tract = np.nan
except:
self.census_tract = np.nan