Page 1 of 1

Write a function create_fair_play_table(df) to depict a barplot with horizontal bars representing total booking points.

Posted: Fri May 20, 2022 3:04 pm
by answerhappygod
Write a function create_fair_play_table(df) to depict
a barplot with horizontal
bars representing total booking points.
The module seaborn and its corresponding methods and
attributes must be used in this question.
Produce a bar for each team (use the HST and AST columns) and
plot them in increasing order. The team with the top bar
(i.e. lowest HST+AST) will represent the Fair Play
League Champion. Also, print the statement below
Write A Function Create Fair Play Table Df To Depict A Barplot With Horizontal Bars Representing Total Booking Points 1
Write A Function Create Fair Play Table Df To Depict A Barplot With Horizontal Bars Representing Total Booking Points 1 (53.88 KiB) Viewed 58 times
Python Code :
def create_fair_play_table(df):
# your code here return
df_fp df_fp = create_fair_play_table(df)
DATA :
index,Div,Date,Time,HomeTeam,AwayTeam,FTHG,FTAG,FTR,HTHG,HTAG,HTR,Referee,HS,AS,HST,AST,HF,AF,HC,AC
0,E0,12/09/2020,12:30,Fulham,Arsenal,0,3,A,0,1,A,C
Kavanagh,5,13,2,6,12,12,2,3 1,E0,12/09/2020,15:00,Crystal
Palace,Southampton,1,0,H,1,0,H,J Moss,5,9,3,5,14,11,7,3
2,E0,12/09/2020,17:30,Liverpool,Leeds,4,3,H,3,2,H,M
Oliver,22,6,6,3,9,6,9,0 3,E0,12/09/2020,20:00,West
Ham,Newcastle,0,2,A,0,0,D,S Attwell,15,15,3,2,13,7,8,7
4,E0,13/09/2020,14:00,West Brom,Leicester,0,3,A,0,0,D,A
Taylor,7,13,1,7,12,9,2,5
5,E0,13/09/2020,16:30,Tottenham,Everton,0,1,A,0,0,D,M
Atkinson,9,15,5,4,15,7,5,3
6,E0,14/09/2020,20:15,Brighton,Chelsea,1,3,A,0,1,A,C
Pawson,13,10,3,5,8,13,4,3 7,E0,14/09/2020,18:00,Sheffield
United,Wolves,0,2,A,0,2,A,M Dean,9,11,2,4,13,7,12,5
8,E0,19/09/2020,12:30,Everton,West Brom,5,2,H,2,1,H,M
Dean,17,6,7,4,9,11,11,1
9,E0,19/09/2020,15:00,Leeds,Fulham,4,3,H,2,1,H,A
Taylor,10,14,7,6,13,18,5,3
The champions of the 2020-2021 Fair Play League is {locate the team here). Teams Liverpool Burnley Man City Wolves Chelsea West Ham Tottenham Crystal Palace Southampton Arsenal Brighton Leicester West Brom Everton Leeds Man United Newcastle Aston Villa Fulham Sheffield United 0 100 200 700 800 300 400 500 600 Fair Play Points