DimaPhil
commited on
Commit
·
a90690d
1
Parent(s):
97c1177
Remove deprecated Python loading script
Browse files- wine-quality.py +0 -27
wine-quality.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 1 |
-
import csv
|
| 2 |
-
import os
|
| 3 |
-
import pandas as pd
|
| 4 |
-
from datasets import GeneratorBasedBuilder, DatasetInfo, SplitGenerator, Split
|
| 5 |
-
|
| 6 |
-
class WineQuality(GeneratorBasedBuilder):
|
| 7 |
-
VERSION = "1.0.0"
|
| 8 |
-
|
| 9 |
-
def _info(self):
|
| 10 |
-
return DatasetInfo(
|
| 11 |
-
description="This is the dataset of Wine Quality, it consists of two parts: red and white"
|
| 12 |
-
)
|
| 13 |
-
|
| 14 |
-
def _split_generators(self, dl_manager):
|
| 15 |
-
filepaths = dl_manager.download_and_extract({
|
| 16 |
-
"red": "winequality-red.csv",
|
| 17 |
-
"white": "winequality-white.csv"
|
| 18 |
-
})
|
| 19 |
-
return [
|
| 20 |
-
SplitGenerator(name="red", gen_kwargs={"filepath": filepaths["red"]}),
|
| 21 |
-
SplitGenerator(name="white", gen_kwargs={"filepath": filepaths["white"]}),
|
| 22 |
-
]
|
| 23 |
-
|
| 24 |
-
def _generate_examples(self, filepath):
|
| 25 |
-
df = pd.read_csv(filepath, delimiter=";")
|
| 26 |
-
for id_, row in df.iterrows():
|
| 27 |
-
yield id_, row.to_dict()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|