-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_types.py
More file actions
42 lines (41 loc) · 1006 Bytes
/
data_types.py
File metadata and controls
42 lines (41 loc) · 1006 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
42
class Purchase:
def __init__(
self,
city,
zipcode,
state,
beds,
baths,
sq__ft,
home_type,
sale_date,
price,
latitude,
longitude,
):
self.longitude = longitude
self.latitude = latitude
self.price = price
self.sale_date = sale_date
self.type = home_type
self.sq__ft = sq__ft
self.baths = baths
self.beds = beds
self.state = state
self.zip = zipcode
self.city = city
@staticmethod
def create_from_dict(lookup):
return Purchase(
lookup["city"],
lookup["zip"],
lookup["state"],
int(lookup["beds"]),
int(lookup["baths"]),
int(lookup["sq__ft"]),
lookup["type"],
lookup["sale_date"],
float(lookup["price"]),
float(lookup["latitude"]),
float(lookup["longitude"]),
)