Update test_dataset.py
Browse files- test_dataset.py +4 -5
test_dataset.py
CHANGED
@@ -57,11 +57,10 @@ class HealthStatisticsDataset(datasets.GeneratorBasedBuilder):
|
|
57 |
def _generate_examples(self, data):
|
58 |
for key, row in data.iterrows():
|
59 |
year = int(row['Year']) if 'Year' in row else None
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
latitude, longitude = None, None
|
65 |
yield key, {
|
66 |
"Year": year,
|
67 |
"LocationAbbr": row.get('LocationAbbr', None),
|
|
|
57 |
def _generate_examples(self, data):
|
58 |
for key, row in data.iterrows():
|
59 |
year = int(row['Year']) if 'Year' in row else None
|
60 |
+
latitude, longitude = None, None
|
61 |
+
if isinstance(row['Geolocation'], str):
|
62 |
+
geo_str = row['Geolocation'].replace('POINT (', '').replace(')', '')
|
63 |
+
longitude, latitude = map(float, geo_str.split())
|
|
|
64 |
yield key, {
|
65 |
"Year": year,
|
66 |
"LocationAbbr": row.get('LocationAbbr', None),
|