Jiwonny29 commited on
Commit
9fae2fc
1 Parent(s): d93980f

Update test_dataset.py

Browse files
Files changed (1) hide show
  1. test_dataset.py +22 -22
test_dataset.py CHANGED
@@ -63,17 +63,17 @@ class NewDataset(datasets.GeneratorBasedBuilder):
63
  description=_DESCRIPTION,
64
  features=datasets.Features(
65
  {
66
- "year": datasets.Value("int32"),
67
- "locationabbr": datasets.Value("string"),
68
- "locationdesc": datasets.Value("string"),
69
- "geolocation": datasets.Features({"latitude": datasets.Value("float32"), "longitude": datasets.Value("float32")}),
70
- "disease_type": datasets.Value("int32"),
71
- "data_value_type": datasets.Value("int32"),
72
- "data_value": datasets.Value("float32"),
73
- "break_out_category": datasets.Value("string"),
74
- "break_out_details": datasets.Value("string"),
75
- "break_out_type": datasets.Value("int32"),
76
- "life_expectancy": datasets.Value("float32")
77
  # These are the features of your dataset like images, labels ...
78
  }
79
  ),
@@ -101,20 +101,20 @@ class NewDataset(datasets.GeneratorBasedBuilder):
101
  reader = csv.DictReader(f)
102
  for key, row in enumerate(reader):
103
  yield key, {
104
- "year": int(row["Year"]),
105
- "location_abbr": row["LocationAbbr"],
106
- "location_desc": row["LocationDesc"],
107
- "geolocation": {
108
  "latitude": float(row["latitude"]),
109
  "longitude": float(row["longitude"])
110
  },
111
- "disease_type": int(row["Disease_Type"]),
112
- "data_value_type": int(row["Data_Value_Type"]),
113
- "data_value": float(row["Data_Value"]),
114
- "break_out_category": row["Break_Out_Category"],
115
- "break_out_details": row["Break_Out_Details"],
116
- "break_out_type": int(row["Break_Out_Type"]),
117
- "life_expectancy": float(row["Life_Expectancy"]) if row["Life_Expectancy"] else None
118
  }
119
 
120
  @staticmethod
 
63
  description=_DESCRIPTION,
64
  features=datasets.Features(
65
  {
66
+ "Year": datasets.Value("int32"),
67
+ "LocationAbbr": datasets.Value("string"),
68
+ "LocationDesc": datasets.Value("string"),
69
+ "Geolocation": datasets.Features({"latitude": datasets.Value("float32"), "longitude": datasets.Value("float32")}),
70
+ "Disease_Type": datasets.Value("int32"),
71
+ "Data_Value_Type": datasets.Value("int32"),
72
+ "Data_Value": datasets.Value("float32"),
73
+ "Break_Out_Category": datasets.Value("string"),
74
+ "Break_Out_Details": datasets.Value("string"),
75
+ "Break_Out_Type": datasets.Value("int32"),
76
+ "Life_Expectancy": datasets.Value("float32")
77
  # These are the features of your dataset like images, labels ...
78
  }
79
  ),
 
101
  reader = csv.DictReader(f)
102
  for key, row in enumerate(reader):
103
  yield key, {
104
+ "Year": int(row["Year"]),
105
+ "Location_Abbr": row["LocationAbbr"],
106
+ "Location_Desc": row["LocationDesc"],
107
+ "Geolocation": {
108
  "latitude": float(row["latitude"]),
109
  "longitude": float(row["longitude"])
110
  },
111
+ "Disease_Type": int(row["Disease_Type"]),
112
+ "Data_Value_Type": int(row["Data_Value_Type"]),
113
+ "Data_Value": float(row["Data_Value"]),
114
+ "Break_Out_Category": row["Break_Out_Category"],
115
+ "Break_Out_Details": row["Break_Out_Details"],
116
+ "Break_Out_Type": int(row["Break_Out_Type"]),
117
+ "Life_Expectancy": float(row["Life_Expectancy"]) if row["Life_Expectancy"] else None
118
  }
119
 
120
  @staticmethod