mstz commited on
Commit
678d061
1 Parent(s): 08a4bc0

Upload magic.py

Browse files
Files changed (1) hide show
  1. magic.py +1 -0
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)