Jiwonny29 commited on
Commit
c8492dd
1 Parent(s): 0ea4101

Update test_dataset.py

Browse files
Files changed (1) hide show
  1. 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
- if 'Geolocation' in row and isinstance(row['Geolocation'], str):
61
- geo_str = row['Geolocation'].replace('(', '').replace(')', '')
62
- latitude, longitude = map(float, geo_str.split(', '))
63
- else:
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),