Datasets:
Update blood.py
Browse files
blood.py
CHANGED
@@ -75,8 +75,6 @@ class Blood(datasets.GeneratorBasedBuilder):
|
|
75 |
data = pandas.read_csv(filepath, header=None)
|
76 |
data.columns = _BASE_FEATURE_NAMES
|
77 |
|
78 |
-
data["months_since_last_donation"] = data["months_since_last_donation"].apply(lambda x: x.values[0] if isinstance(x, pandas.Series) else x)
|
79 |
-
|
80 |
data = data.astype({
|
81 |
"months_since_last_donation": "int64",
|
82 |
"total_donation": "int64",
|
@@ -87,5 +85,8 @@ class Blood(datasets.GeneratorBasedBuilder):
|
|
87 |
|
88 |
for row_id, row in data.iterrows():
|
89 |
data_row = dict(row)
|
|
|
|
|
|
|
90 |
|
91 |
yield row_id, data_row
|
|
|
75 |
data = pandas.read_csv(filepath, header=None)
|
76 |
data.columns = _BASE_FEATURE_NAMES
|
77 |
|
|
|
|
|
78 |
data = data.astype({
|
79 |
"months_since_last_donation": "int64",
|
80 |
"total_donation": "int64",
|
|
|
85 |
|
86 |
for row_id, row in data.iterrows():
|
87 |
data_row = dict(row)
|
88 |
+
|
89 |
+
if isinstance(data_row["months_since_last_donation"], pandas.Series):
|
90 |
+
data_row["months_since_last_donation"] = data_row["months_since_last_donation"].values[0]
|
91 |
|
92 |
yield row_id, data_row
|