ForzaJuve1
commited on
Commit
•
de6caeb
1
Parent(s):
f4e82a4
Update Integration.py
Browse files- Integration.py +36 -38
Integration.py
CHANGED
@@ -553,14 +553,12 @@ class Euro2020Dataset(GeneratorBasedBuilder):
|
|
553 |
#csv.field_size_limit(sys.maxsize)
|
554 |
|
555 |
def _generate_examples(self, filepath):
|
556 |
-
|
557 |
-
for batch in table.to_batches():
|
558 |
-
for row in batch.to_pydict():
|
559 |
-
yield row
|
560 |
#table = pq.read_table(filepath)
|
561 |
#df = table.to_pandas()
|
562 |
-
|
563 |
-
|
|
|
564 |
#'id' here is the index of the row in the DataFrame
|
565 |
#'row' is a Pandas Series object representing the row data
|
566 |
#Directly yield the id and row.to_dict() if the DataFrame structure matches the desired output
|
@@ -594,36 +592,36 @@ class Euro2020Dataset(GeneratorBasedBuilder):
|
|
594 |
#pre_match_replaced = pre_match_replaced.replace(": nan", ": null")
|
595 |
#pre_match_info = yaml.safe_load(pre_match_str)
|
596 |
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
|
|
|
553 |
#csv.field_size_limit(sys.maxsize)
|
554 |
|
555 |
def _generate_examples(self, filepath):
|
556 |
+
|
|
|
|
|
|
|
557 |
#table = pq.read_table(filepath)
|
558 |
#df = table.to_pandas()
|
559 |
+
df = pd.read_parquet(filepath)
|
560 |
+
for id, row in df.iterrows():
|
561 |
+
|
562 |
#'id' here is the index of the row in the DataFrame
|
563 |
#'row' is a Pandas Series object representing the row data
|
564 |
#Directly yield the id and row.to_dict() if the DataFrame structure matches the desired output
|
|
|
592 |
#pre_match_replaced = pre_match_replaced.replace(": nan", ": null")
|
593 |
#pre_match_info = yaml.safe_load(pre_match_str)
|
594 |
|
595 |
+
yield id, {
|
596 |
+
"HomeTeamName": row["HomeTeamName"],
|
597 |
+
"AwayTeamName": row["AwayTeamName"],
|
598 |
+
"DateandTimeCET": row["DateandTimeCET"],
|
599 |
+
"MatchID": row["MatchID"],
|
600 |
+
"RoundName": row["RoundName"],
|
601 |
+
"Stage": row["Stage"],
|
602 |
+
"MatchDay": row["MatchDay"],
|
603 |
+
"Session": row["Session"],
|
604 |
+
"MatchMinute": row["MatchMinute"],
|
605 |
+
"InjuryTime": row["InjuryTime"],
|
606 |
+
"NumberOfPhases": row["NumberOfPhases"],
|
607 |
+
"Phase": row["Phase"],
|
608 |
+
"ScoreHome": row["ScoreHome"],
|
609 |
+
"ScoreAway": row["ScoreAway"],
|
610 |
+
"MatchStatus": row["MatchStatus"],
|
611 |
+
"StadiumID": row["StadiumID"],
|
612 |
+
"RefereeWebName": row["RefereeWebName"],
|
613 |
+
"NumberofMatchesRefereedPostMatch": row["NumberofMatchesRefereedPostMatch"],
|
614 |
+
"TotalNumberofMatchesRefereed": row["TotalNumberofMatchesRefereed"],
|
615 |
+
"NumberofMatchesRefereedinGroupStage": row["NumberofMatchesRefereedinGroupStage"],
|
616 |
+
"NumberofMatchesRefereedinKnockoutStage": row["NumberofMatchesRefereedinKnockoutStage"],
|
617 |
+
"AssistantRefereeWebName": row["AssistantRefereeWebName"],
|
618 |
+
"Humidity": row["Humidity"],
|
619 |
+
"Temperature": row["Temperature"],
|
620 |
+
"WindSpeed": row["WindSpeed"],
|
621 |
+
"MatchEvent": row["MatchEvent"],
|
622 |
+
"TeamLineUps": row["TeamLineUps"],
|
623 |
+
"TeamStats": row["TeamStats"],
|
624 |
+
"PlayerStats": row["PlayerStats"],
|
625 |
+
"PlayerPreMatchInfo": row["PlayerPreMatchInfo"],
|
626 |
+
}
|
627 |
|