I have a dataset on which I was asked to write a pyspark code for the following question.
List of Winners of Each World champions Trophy Hint: Total Result of all rounds of Tournament for that player is considered as that player's
Score/Result.
Result attributes: winner, tournament_name
I wrote this code:
game_info = spark.read.load("/content/chess/chess_wc_history_game_info.csv",
format="csv", sep=",", inferSchema="true", header="true")
game_info.groupBy('winner').show()
But on execution I got an error as:
AttributeError: 'GroupedData' object has no attribute 'show'
show()method ondf.groupBy(). theagg()has to accompany it.List of Winners of Each World champions Trophy Hint: Total Result of all rounds of Tournament for that player is considered as that player's Score/Result. Result attributes: winner, tournament_namethis is what I have to find out