ForzaJuve1
commited on
Commit
•
19d79cd
1
Parent(s):
0b199f4
Update Integration.py
Browse files- Integration.py +9 -2
Integration.py
CHANGED
@@ -7,6 +7,7 @@ import ast
|
|
7 |
import json
|
8 |
import yaml
|
9 |
import requests
|
|
|
10 |
|
11 |
class Euro2020Dataset(GeneratorBasedBuilder):
|
12 |
VERSION = "1.0.0"
|
@@ -563,12 +564,18 @@ class Euro2020Dataset(GeneratorBasedBuilder):
|
|
563 |
#csv.field_size_limit(sys.maxsize)
|
564 |
|
565 |
def _generate_examples(self, filepath):
|
566 |
-
|
|
|
567 |
for id, row in df.iterrows():
|
|
|
|
|
|
|
|
|
|
|
568 |
# 'id' here is the index of the row in the DataFrame
|
569 |
# 'row' is a Pandas Series object representing the row data
|
570 |
# Directly yield the id and row.to_dict() if the DataFrame structure matches the desired output
|
571 |
-
yield id, row.to_dict()
|
572 |
#with open(filepath, encoding="utf-8") as f:
|
573 |
#reader = pd.read_parquet(f)
|
574 |
#for id, row in enumerate(reader):
|
|
|
7 |
import json
|
8 |
import yaml
|
9 |
import requests
|
10 |
+
import pyarrow.parquet as pq
|
11 |
|
12 |
class Euro2020Dataset(GeneratorBasedBuilder):
|
13 |
VERSION = "1.0.0"
|
|
|
564 |
#csv.field_size_limit(sys.maxsize)
|
565 |
|
566 |
def _generate_examples(self, filepath):
|
567 |
+
table = pq.read_table(filepath)
|
568 |
+
df = table.to_pandas()
|
569 |
for id, row in df.iterrows():
|
570 |
+
yield id, row.to_dict()
|
571 |
+
|
572 |
+
#def _generate_examples(self, filepath):
|
573 |
+
#df = pd.read_parquet(filepath)
|
574 |
+
#for id, row in df.iterrows():
|
575 |
# 'id' here is the index of the row in the DataFrame
|
576 |
# 'row' is a Pandas Series object representing the row data
|
577 |
# Directly yield the id and row.to_dict() if the DataFrame structure matches the desired output
|
578 |
+
#yield id, row.to_dict()
|
579 |
#with open(filepath, encoding="utf-8") as f:
|
580 |
#reader = pd.read_parquet(f)
|
581 |
#for id, row in enumerate(reader):
|