Datasets:
Update compas.py
Browse files
compas.py
CHANGED
@@ -301,7 +301,7 @@ class Compas(datasets.GeneratorBasedBuilder):
|
|
301 |
in_dates = data.in_custody.apply(datetime.date.fromisoformat)
|
302 |
out_dates = data.out_custody.apply(datetime.date.fromisoformat)
|
303 |
days_in_custody = [delta.days for delta in out_dates - in_dates]
|
304 |
-
data["days_in_custody"] = days_in_custody
|
305 |
data.drop("in_custody", axis="columns", inplace=True)
|
306 |
data.drop("out_custody", axis="columns", inplace=True)
|
307 |
|
|
|
301 |
in_dates = data.in_custody.apply(datetime.date.fromisoformat)
|
302 |
out_dates = data.out_custody.apply(datetime.date.fromisoformat)
|
303 |
days_in_custody = [delta.days for delta in out_dates - in_dates]
|
304 |
+
data.loc[:, "days_in_custody"] = days_in_custody
|
305 |
data.drop("in_custody", axis="columns", inplace=True)
|
306 |
data.drop("out_custody", axis="columns", inplace=True)
|
307 |
|