HathawayLiu
commited on
Commit
·
17f35ea
1
Parent(s):
14842f3
update
Browse files- housing_dataset.py +8 -12
housing_dataset.py
CHANGED
@@ -84,10 +84,10 @@ class HousingDataset(datasets.GeneratorBasedBuilder):
|
|
84 |
"housingunitsremoved": datasets.Value("int64"),
|
85 |
"housingunitsadded": datasets.Value("int64"),
|
86 |
"estprojectcost": datasets.Value("float32"),
|
87 |
-
"applieddate": datasets.Value("
|
88 |
-
"issueddate": datasets.Value("
|
89 |
-
"expiresdate": datasets.Value("
|
90 |
-
"completeddate": datasets.Value("
|
91 |
"statuscurrent": datasets.Value("string"),
|
92 |
"relatedmup": datasets.Value("string"),
|
93 |
"originaladdress1": datasets.Value("string"),
|
@@ -130,10 +130,6 @@ class HousingDataset(datasets.GeneratorBasedBuilder):
|
|
130 |
|
131 |
housing_df['Latitude'] = housing_df['Latitude'].astype(float)
|
132 |
housing_df['Longitude'] = housing_df['Longitude'].astype(float)
|
133 |
-
housing_df['IssuedDate'] = pd.to_datetime(housing_df['IssuedDate'], errors='coerce')
|
134 |
-
housing_df['AppliedDate'] = pd.to_datetime(housing_df['AppliedDate'], errors='coerce')
|
135 |
-
housing_df['ExpiresDate'] = pd.to_datetime(housing_df['ExpiresDate'], errors='coerce')
|
136 |
-
housing_df['CompletedDate'] = pd.to_datetime(housing_df['CompletedDate'], errors='coerce')
|
137 |
|
138 |
# Iterating through each row to generate examples
|
139 |
for index, row in housing_df.iterrows():
|
@@ -148,10 +144,10 @@ class HousingDataset(datasets.GeneratorBasedBuilder):
|
|
148 |
"housingunitsremoved": int(row.get("HousingUnitsRemoved", "")),
|
149 |
"housingunitsadded": int(row.get("HousingUnitsAdded", "")),
|
150 |
"estprojectcost": float(row.get("EstProjectCost", "")),
|
151 |
-
"applieddate": row.get("AppliedDate", ""),
|
152 |
-
"issueddate": row.get("IssuedDate", ""),
|
153 |
-
"expiresdate": row.get("ExpiresDate", ""),
|
154 |
-
"completeddate": row.get("CompletedDate", ""),
|
155 |
"statuscurrent": row.get("StatusCurrent", ""),
|
156 |
"relatedmup": row.get("RelatedMup", ""),
|
157 |
"originaladdress1": row.get("OriginalAddress1", ""),
|
|
|
84 |
"housingunitsremoved": datasets.Value("int64"),
|
85 |
"housingunitsadded": datasets.Value("int64"),
|
86 |
"estprojectcost": datasets.Value("float32"),
|
87 |
+
"applieddate": datasets.Value("string"),
|
88 |
+
"issueddate": datasets.Value("string"),
|
89 |
+
"expiresdate": datasets.Value("string"),
|
90 |
+
"completeddate": datasets.Value("string"),
|
91 |
"statuscurrent": datasets.Value("string"),
|
92 |
"relatedmup": datasets.Value("string"),
|
93 |
"originaladdress1": datasets.Value("string"),
|
|
|
130 |
|
131 |
housing_df['Latitude'] = housing_df['Latitude'].astype(float)
|
132 |
housing_df['Longitude'] = housing_df['Longitude'].astype(float)
|
|
|
|
|
|
|
|
|
133 |
|
134 |
# Iterating through each row to generate examples
|
135 |
for index, row in housing_df.iterrows():
|
|
|
144 |
"housingunitsremoved": int(row.get("HousingUnitsRemoved", "")),
|
145 |
"housingunitsadded": int(row.get("HousingUnitsAdded", "")),
|
146 |
"estprojectcost": float(row.get("EstProjectCost", "")),
|
147 |
+
"applieddate": str(row.get("AppliedDate", "")),
|
148 |
+
"issueddate": str(row.get("IssuedDate", "")),
|
149 |
+
"expiresdate": str(row.get("ExpiresDate", "")),
|
150 |
+
"completeddate": str(row.get("CompletedDate", "")),
|
151 |
"statuscurrent": row.get("StatusCurrent", ""),
|
152 |
"relatedmup": row.get("RelatedMup", ""),
|
153 |
"originaladdress1": row.get("OriginalAddress1", ""),
|