Update NYC_Motor_Vehicle_Collisions_and_Weather_Dataset.py
Browse files
NYC_Motor_Vehicle_Collisions_and_Weather_Dataset.py
CHANGED
@@ -82,12 +82,12 @@ class NYCMotorVehicleCollisionsWeatherDataset(datasets.GeneratorBasedBuilder):
|
|
82 |
},
|
83 |
),
|
84 |
]
|
85 |
-
|
86 |
def _generate_examples(self, filepath, split):
|
87 |
with open(filepath, encoding="utf-8") as f:
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
"crash_date": row["crash_date"],
|
92 |
"borough": row["borough"],
|
93 |
"zip_code": row["zip_code"],
|
|
|
82 |
},
|
83 |
),
|
84 |
]
|
85 |
+
}
|
86 |
def _generate_examples(self, filepath, split):
|
87 |
with open(filepath, encoding="utf-8") as f:
|
88 |
+
for key, line in enumerate(f):
|
89 |
+
row = json.loads(line)
|
90 |
+
yield key, {
|
91 |
"crash_date": row["crash_date"],
|
92 |
"borough": row["borough"],
|
93 |
"zip_code": row["zip_code"],
|