Datasets:
Upload diamonds.py
Browse files- diamonds.py +1 -0
diamonds.py
CHANGED
|
@@ -118,6 +118,7 @@ class Diamond(datasets.GeneratorBasedBuilder):
|
|
| 118 |
data.loc[:, "clarity"] = data.clarity.apply(encode_clarity)
|
| 119 |
|
| 120 |
encode_cut = partial(self.encode, "cut")
|
|
|
|
| 121 |
data.loc[:, "cut"] = data.cut.apply(encode_cut)
|
| 122 |
|
| 123 |
data.columns = _BASE_FEATURE_NAMES
|
|
|
|
| 118 |
data.loc[:, "clarity"] = data.clarity.apply(encode_clarity)
|
| 119 |
|
| 120 |
encode_cut = partial(self.encode, "cut")
|
| 121 |
+
data.loc[:, "cut"] = data.cut.apply(lambda x: x.replace("b", "").replace("'", ""))
|
| 122 |
data.loc[:, "cut"] = data.cut.apply(encode_cut)
|
| 123 |
|
| 124 |
data.columns = _BASE_FEATURE_NAMES
|