HathawayLiu
commited on
Commit
•
14842f3
1
Parent(s):
f49330b
update
Browse files- housing_dataset.py +6 -0
housing_dataset.py
CHANGED
@@ -123,11 +123,17 @@ class HousingDataset(datasets.GeneratorBasedBuilder):
|
|
123 |
def _generate_examples(self, housing_data):
|
124 |
"""This function returns the examples in the raw (text) form."""
|
125 |
housing_df = pd.read_csv(housing_data)
|
|
|
126 |
housing_df['EstProjectCost'] = housing_df["EstProjectCost"].replace('NA', 0)
|
127 |
housing_df.dropna(subset = ['Latitude'], inplace = True)
|
128 |
housing_df.dropna(subset = ['OriginalZip'], inplace = True)
|
|
|
129 |
housing_df['Latitude'] = housing_df['Latitude'].astype(float)
|
130 |
housing_df['Longitude'] = housing_df['Longitude'].astype(float)
|
|
|
|
|
|
|
|
|
131 |
|
132 |
# Iterating through each row to generate examples
|
133 |
for index, row in housing_df.iterrows():
|
|
|
123 |
def _generate_examples(self, housing_data):
|
124 |
"""This function returns the examples in the raw (text) form."""
|
125 |
housing_df = pd.read_csv(housing_data)
|
126 |
+
|
127 |
housing_df['EstProjectCost'] = housing_df["EstProjectCost"].replace('NA', 0)
|
128 |
housing_df.dropna(subset = ['Latitude'], inplace = True)
|
129 |
housing_df.dropna(subset = ['OriginalZip'], inplace = True)
|
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():
|