Datasets:
Upload magic.py
Browse files
magic.py
CHANGED
@@ -89,6 +89,7 @@ class Magic(datasets.GeneratorBasedBuilder):
|
|
89 |
def _generate_examples(self, filepath: str):
|
90 |
data = pandas.read_csv(filepath, header=None)
|
91 |
data.columns = _BASE_FEATURE_NAMES
|
|
|
92 |
|
93 |
for row_id, row in data.iterrows():
|
94 |
data_row = dict(row)
|
|
|
89 |
def _generate_examples(self, filepath: str):
|
90 |
data = pandas.read_csv(filepath, header=None)
|
91 |
data.columns = _BASE_FEATURE_NAMES
|
92 |
+
data.loc[:, "class"] = data["class"].apply(lambda x: 1 if x == "g" else 0)
|
93 |
|
94 |
for row_id, row in data.iterrows():
|
95 |
data_row = dict(row)
|