ForzaJuve1 commited on
Commit
de6caeb
1 Parent(s): f4e82a4

Update Integration.py

Browse files
Files changed (1) hide show
  1. 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
- table = pq.read_table(filepath)
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
- #df = pd.read_parquet(filepath)
563
- #for id, row in df.iterrows():
 
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
- #yield id, {
598
- #"HomeTeamName": row["HomeTeamName"],
599
- #"AwayTeamName": row["AwayTeamName"],
600
- #"DateandTimeCET": row["DateandTimeCET"],
601
- #"MatchID": row["MatchID"],
602
- #"RoundName": row["RoundName"],
603
- #"Stage": row["Stage"],
604
- #"MatchDay": row["MatchDay"],
605
- #"Session": row["Session"],
606
- #"MatchMinute": row["MatchMinute"],
607
- #"InjuryTime": row["InjuryTime"],
608
- #"NumberOfPhases": row["NumberOfPhases"],
609
- #"Phase": row["Phase"],
610
- #"ScoreHome": row["ScoreHome"],
611
- #"ScoreAway": row["ScoreAway"],
612
- #"MatchStatus": row["MatchStatus"],
613
- #"StadiumID": row["StadiumID"],
614
- #"RefereeWebName": row["RefereeWebName"],
615
- #"NumberofMatchesRefereedPostMatch": row["NumberofMatchesRefereedPostMatch"],
616
- #"TotalNumberofMatchesRefereed": row["TotalNumberofMatchesRefereed"],
617
- #"NumberofMatchesRefereedinGroupStage": row["NumberofMatchesRefereedinGroupStage"],
618
- #"NumberofMatchesRefereedinKnockoutStage": row["NumberofMatchesRefereedinKnockoutStage"],
619
- #"AssistantRefereeWebName": row["AssistantRefereeWebName"],
620
- #"Humidity": row["Humidity"],
621
- #"Temperature": row["Temperature"],
622
- #"WindSpeed": row["WindSpeed"],
623
- #"MatchEvent": row["MatchEvent"],
624
- #"TeamLineUps": row["TeamLineUps"],
625
- #"TeamStats": row["TeamStats"],
626
- #"PlayerStats": row["PlayerStats"],
627
- #"PlayerPreMatchInfo": row["PlayerPreMatchInfo"],
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