Unit 2.3 Hacks
Libraries
• 23 min read
import base64
text = "Y A S"
# my initials in base64
encoded_bytes = base64.b64encode(text.encode('utf-8'))
encoded_text = encoded_bytes.decode('utf-8')
print(encoded_text)
# encodes the text "YAS" to base64 format
# its like 2 to the 6th power
# Divides 3 bytes into 6-bit groups
WSBBIFM=
import pandas as pd
df = pd.read_json("../datasets/prem.json")
print(df)
AC AF AR AS AST AY AwayTeam B365A B365D B365H ... PSCH \ 0 4 12 0 6 3 1 Leicester 6.50 4.50 1.53 ... 1.49 1 10 9 0 14 4 2 Man City 1.33 5.50 11.00 ... 11.75 2 5 11 0 10 5 3 Burnley 15.00 6.50 1.25 ... 1.33 3 9 19 0 8 6 3 Huddersfield 5.00 3.60 1.83 ... 1.79 4 7 10 0 9 1 1 Stoke 5.75 3.80 1.70 ... 1.82 .. .. .. .. .. ... .. ... ... ... ... ... ... 375 2 10 0 6 2 1 Chelsea 1.60 4.20 6.50 ... 4.85 376 12 10 0 13 2 1 Man City 1.39 5.00 9.00 ... 6.32 377 0 9 0 8 5 2 Stoke 4.20 3.79 1.90 ... 2.08 378 4 13 0 16 9 2 Leicester 9.00 6.00 1.33 ... 1.38 379 6 13 0 14 7 1 Everton 3.00 3.50 2.45 ... 2.35 PSD PSH Referee VCA VCD VCH WHA WHD WHH 0 4.55 1.53 M Dean 6.50 4.50 1.53 6.00 4.20 1.53 1 5.55 10.95 M Oliver 1.33 5.50 10.00 1.33 4.80 10.00 2 6.30 1.26 C Pawson 15.00 6.25 1.25 13.00 5.50 1.25 3 3.58 1.83 J Moss 5.00 3.60 1.83 5.00 3.30 1.80 4 3.83 1.70 N Swarbrick 5.75 3.80 1.70 5.50 3.50 1.70 .. ... ... ... ... ... ... ... ... ... 375 4.22 5.96 M Atkinson 1.60 4.20 6.00 1.57 4.00 6.50 376 5.11 8.06 A Marriner 1.44 5.00 7.50 1.40 4.50 8.50 377 3.72 1.91 A Taylor 4.20 3.75 1.90 4.00 3.75 1.91 378 5.95 1.33 C Pawson 9.50 5.75 1.33 9.00 6.00 1.30 379 3.51 2.36 G Scott 3.10 3.50 2.40 3.10 3.30 2.40 [380 rows x 65 columns]
import pandas as pd
df = pd.read_json("../datasets/prem.json")
print(df[['HomeTeam', 'FTHG', 'FTAG', 'AwayTeam', 'Referee']].to_string(index=False))
#df represents the data set
# Printing specific collumns
HomeTeam FTHG FTAG AwayTeam Referee Arsenal 4 3 Leicester M Dean Brighton 0 2 Man City M Oliver Chelsea 2 3 Burnley C Pawson Crystal Palace 0 3 Huddersfield J Moss Everton 1 0 Stoke N Swarbrick Southampton 0 0 Swansea M Jones Watford 3 3 Liverpool A Taylor West Brom 1 0 Bournemouth R Madley Man United 4 0 West Ham M Atkinson Newcastle 0 2 Tottenham A Marriner Bournemouth 0 2 Watford R East Burnley 0 1 West Brom M Atkinson Leicester 2 0 Brighton L Probert Liverpool 1 0 Crystal Palace K Friend Southampton 3 2 West Ham L Mason Stoke 1 0 Arsenal A Marriner Swansea 0 4 Man United J Moss Huddersfield 1 0 Newcastle C Pawson Tottenham 1 2 Chelsea A Taylor Man City 1 1 Everton R Madley Bournemouth 1 2 Man City M Dean Crystal Palace 0 2 Swansea A Marriner Huddersfield 0 0 Southampton S Attwell Man United 2 0 Leicester M Oliver Newcastle 3 0 West Ham N Swarbrick Watford 0 0 Brighton G Scott Chelsea 2 0 Everton J Moss Liverpool 4 0 Arsenal C Pawson Tottenham 1 1 Burnley L Mason West Brom 1 1 Stoke A Taylor Arsenal 3 0 Bournemouth A Taylor Brighton 3 1 West Brom C Kavanagh Everton 0 3 Tottenham G Scott Leicester 1 2 Chelsea L Mason Man City 5 0 Liverpool J Moss Southampton 0 2 Watford L Probert Stoke 2 2 Man United N Swarbrick Burnley 1 0 Crystal Palace M Oliver Swansea 0 1 Newcastle M Jones West Ham 2 0 Huddersfield K Friend Bournemouth 2 1 Brighton C Pawson Crystal Palace 0 1 Southampton R Madley Huddersfield 1 1 Leicester J Moss Liverpool 1 1 Burnley R East Newcastle 2 1 Stoke S Attwell Tottenham 0 0 Swansea M Dean Watford 0 6 Man City A Taylor West Brom 0 0 West Ham P Tierney Chelsea 0 0 Arsenal M Oliver Man United 4 0 Everton A Marriner Burnley 0 0 Huddersfield C Kavanagh Everton 2 1 Bournemouth M Atkinson Leicester 2 3 Liverpool A Taylor Man City 5 0 Crystal Palace N Swarbrick Southampton 0 1 Man United C Pawson Stoke 0 4 Chelsea M Dean Swansea 1 2 Watford L Mason West Ham 2 3 Tottenham M Oliver Brighton 1 0 Newcastle A Marriner Arsenal 2 0 West Brom R Madley Bournemouth 0 0 Leicester G Scott Chelsea 0 1 Man City M Atkinson Huddersfield 0 4 Tottenham N Swarbrick Man United 4 0 Crystal Palace M Dean Stoke 2 1 Southampton M Jones West Brom 2 2 Watford M Oliver West Ham 1 0 Swansea R East Arsenal 2 0 Brighton K Friend Everton 0 1 Burnley J Moss Newcastle 1 1 Liverpool C Pawson Burnley 1 1 West Ham S Attwell Crystal Palace 2 1 Chelsea A Marriner Liverpool 0 0 Man United M Atkinson Man City 7 2 Stoke C Pawson Swansea 2 0 Huddersfield P Tierney Tottenham 1 0 Bournemouth R Madley Watford 2 1 Arsenal N Swarbrick Brighton 1 1 Everton M Oliver Southampton 2 2 Newcastle K Friend Leicester 1 1 West Brom M Dean West Ham 0 3 Brighton M Atkinson Chelsea 4 2 Watford J Moss Huddersfield 2 1 Man United L Mason Man City 3 0 Burnley R East Newcastle 1 0 Crystal Palace S Attwell Southampton 1 0 West Brom G Scott Stoke 1 2 Bournemouth L Probert Swansea 1 2 Leicester M Oliver Everton 2 5 Arsenal C Pawson Tottenham 4 1 Liverpool A Marriner Arsenal 2 1 Swansea L Mason Bournemouth 0 1 Chelsea C Pawson Crystal Palace 2 2 West Ham R Madley Liverpool 3 0 Huddersfield K Friend Man United 1 0 Tottenham J Moss Watford 0 1 Stoke M Oliver West Brom 2 3 Man City M Jones Brighton 1 1 Southampton N Swarbrick Leicester 2 0 Everton A Marriner Burnley 1 0 Newcastle M Dean Huddersfield 1 0 West Brom R East Newcastle 0 1 Bournemouth P Tierney Southampton 0 1 Burnley L Probert Stoke 2 2 Leicester R Madley Swansea 0 1 Brighton M Dean West Ham 1 4 Liverpool N Swarbrick Chelsea 1 0 Man United A Taylor Everton 3 2 Watford G Scott Man City 3 1 Arsenal M Oliver Tottenham 1 0 Crystal Palace K Friend Arsenal 2 0 Tottenham M Dean Bournemouth 4 0 Huddersfield L Probert Burnley 2 0 Swansea M Atkinson Crystal Palace 2 2 Everton A Taylor Leicester 0 2 Man City G Scott Liverpool 3 0 Southampton M Jones Man United 4 1 Newcastle C Pawson West Brom 0 4 Chelsea J Moss Watford 2 0 West Ham A Marriner Brighton 2 2 Stoke L Mason West Ham 1 1 Leicester M Atkinson Crystal Palace 2 1 Stoke M Dean Liverpool 1 1 Chelsea M Oliver Man United 1 0 Brighton N Swarbrick Newcastle 0 3 Watford C Kavanagh Swansea 0 0 Bournemouth S Attwell Tottenham 1 1 West Brom M Jones Burnley 0 1 Arsenal L Mason Huddersfield 1 2 Man City C Pawson Southampton 4 1 Everton K Friend Brighton 0 0 Crystal Palace A Marriner Leicester 2 1 Tottenham A Taylor Watford 2 4 Man United J Moss West Brom 2 2 Newcastle L Probert Arsenal 5 0 Huddersfield G Scott Bournemouth 1 2 Burnley R East Chelsea 1 0 Swansea N Swarbrick Everton 4 0 West Ham M Oliver Man City 2 1 Southampton P Tierney Stoke 0 3 Liverpool M Atkinson Arsenal 1 3 Man United A Marriner Brighton 1 5 Liverpool G Scott Chelsea 3 1 Newcastle K Friend Everton 2 0 Huddersfield C Kavanagh Leicester 1 0 Burnley P Tierney Stoke 2 1 Swansea C Pawson Watford 1 1 Tottenham M Atkinson West Brom 0 0 Crystal Palace M Oliver Bournemouth 1 1 Southampton J Moss Man City 2 1 West Ham M Dean Burnley 1 0 Watford L Probert Crystal Palace 2 2 Bournemouth K Friend Huddersfield 2 0 Brighton S Attwell Newcastle 2 3 Leicester N Swarbrick Swansea 1 0 West Brom M Dean Tottenham 5 1 Stoke R East West Ham 1 0 Chelsea A Taylor Liverpool 1 1 Everton C Pawson Man United 1 2 Man City M Oliver Southampton 1 1 Arsenal R Madley Burnley 1 0 Stoke M Jones Crystal Palace 2 1 Watford L Mason Huddersfield 1 3 Chelsea A Marriner Liverpool 0 0 West Brom P Tierney Man United 1 0 Bournemouth G Scott Newcastle 0 1 Everton M Atkinson Southampton 1 4 Leicester C Kavanagh Swansea 0 4 Man City A Taylor Tottenham 2 0 Brighton R Madley West Ham 0 0 Arsenal J Moss Arsenal 1 0 Newcastle S Attwell Brighton 0 0 Burnley C Kavanagh Chelsea 1 0 Southampton R East Leicester 0 3 Crystal Palace M Atkinson Man City 4 1 Tottenham C Pawson Stoke 0 3 West Ham G Scott Watford 1 4 Huddersfield M Oliver Bournemouth 0 4 Liverpool A Marriner West Brom 1 2 Man United A Taylor Everton 3 1 Swansea J Moss Arsenal 3 3 Liverpool M Atkinson Brighton 1 0 Watford P Tierney Burnley 0 3 Tottenham M Oliver Everton 0 0 Chelsea R Madley Leicester 2 2 Man United J Moss Man City 4 0 Bournemouth M Jones Southampton 1 1 Huddersfield L Probert Stoke 3 1 West Brom N Swarbrick Swansea 1 1 Crystal Palace C Pawson West Ham 2 3 Newcastle L Mason Bournemouth 3 3 West Ham S Attwell Chelsea 2 0 Brighton M Dean Huddersfield 1 1 Stoke A Taylor Liverpool 5 0 Swansea K Friend Man United 2 2 Burnley M Atkinson Tottenham 5 2 Southampton G Scott Watford 2 1 Leicester C Kavanagh West Brom 0 0 Everton R East Newcastle 0 1 Man City A Marriner Crystal Palace 2 3 Arsenal M Oliver Bournemouth 2 1 Everton L Probert Chelsea 5 0 Stoke K Friend Huddersfield 0 0 Burnley P Tierney Liverpool 2 1 Leicester N Swarbrick Man United 0 0 Southampton C Pawson Newcastle 0 0 Brighton A Taylor Watford 1 2 Swansea M Atkinson Crystal Palace 0 0 Man City J Moss West Brom 1 1 Arsenal M Dean Brighton 2 2 Bournemouth M Oliver Burnley 1 2 Liverpool R East Everton 0 2 Man United A Marriner Leicester 3 0 Huddersfield G Scott Stoke 0 1 Newcastle C Kavanagh Man City 3 1 Watford L Mason Southampton 1 2 Crystal Palace S Attwell Swansea 0 2 Tottenham R Madley West Ham 2 1 West Brom M Jones Arsenal 2 2 Chelsea A Taylor Tottenham 1 1 West Ham M Dean Chelsea 0 0 Leicester M Jones Crystal Palace 1 0 Burnley M Oliver Huddersfield 1 4 West Ham J Moss Newcastle 1 1 Swansea G Scott Tottenham 4 0 Everton C Pawson Watford 2 2 Southampton R East West Brom 2 0 Brighton M Atkinson Bournemouth 2 1 Arsenal K Friend Liverpool 4 3 Man City A Marriner Man United 3 0 Stoke A Taylor Arsenal 4 1 Crystal Palace C Kavanagh Brighton 0 4 Chelsea J Moss Burnley 0 1 Man United M Dean Everton 1 1 West Brom S Attwell Leicester 2 0 Watford L Probert Man City 3 1 Newcastle P Tierney Stoke 2 0 Huddersfield M Oliver West Ham 1 1 Bournemouth M Atkinson Southampton 1 1 Tottenham K Friend Swansea 1 0 Liverpool N Swarbrick Huddersfield 0 3 Liverpool K Friend Swansea 3 1 Arsenal L Mason West Ham 1 1 Crystal Palace N Swarbrick Chelsea 0 3 Bournemouth L Probert Everton 2 1 Leicester C Kavanagh Man City 3 0 West Brom R Madley Newcastle 1 1 Burnley S Hooper Southampton 1 1 Brighton M Dean Stoke 0 0 Watford J Moss Tottenham 2 0 Man United A Marriner Arsenal 5 1 Everton N Swarbrick Bournemouth 2 1 Stoke P Tierney Brighton 3 1 West Ham R East Burnley 1 1 Man City M Atkinson Leicester 1 1 Swansea A Taylor Man United 2 0 Huddersfield S Attwell West Brom 2 3 Southampton M Oliver Crystal Palace 1 1 Newcastle A Marriner Liverpool 2 2 Tottenham J Moss Watford 4 1 Chelsea M Dean Everton 3 1 Crystal Palace J Moss Man City 5 1 Leicester M Jones Stoke 1 1 Brighton R Madley Swansea 1 0 Burnley A Marriner Tottenham 1 0 Arsenal A Taylor West Ham 2 0 Watford G Scott Huddersfield 4 1 Bournemouth M Oliver Newcastle 1 0 Man United C Pawson Southampton 0 2 Liverpool M Atkinson Chelsea 3 0 West Brom L Mason Bournemouth 2 2 Newcastle R East Brighton 4 1 Swansea M Dean Burnley 1 1 Southampton R Madley Leicester 1 1 Stoke M Oliver Liverpool 4 1 West Ham S Attwell Watford 1 0 Everton A Taylor West Brom 1 2 Huddersfield J Moss Crystal Palace 0 1 Tottenham K Friend Man United 2 1 Chelsea M Atkinson Arsenal 0 3 Man City A Marriner Burnley 2 1 Everton C Kavanagh Leicester 1 1 Bournemouth L Probert Liverpool 2 0 Newcastle G Scott Southampton 0 0 Stoke A Taylor Swansea 4 1 West Ham M Atkinson Tottenham 2 0 Huddersfield K Friend Watford 1 0 West Brom P Tierney Brighton 2 1 Arsenal S Attwell Man City 1 0 Chelsea M Oliver Crystal Palace 2 3 Man United N Swarbrick Chelsea 2 1 Crystal Palace A Taylor Everton 2 0 Brighton R East Huddersfield 0 0 Swansea M Oliver Man United 2 1 Liverpool C Pawson Newcastle 3 0 Southampton A Marriner West Brom 1 4 Leicester R Madley West Ham 0 3 Burnley L Mason Arsenal 3 0 Watford M Atkinson Bournemouth 1 4 Tottenham M Dean Stoke 0 2 Man City J Moss Bournemouth 2 1 West Brom G Scott Huddersfield 0 2 Crystal Palace M Dean Liverpool 5 0 Watford A Taylor Stoke 1 2 Everton M Atkinson Brighton 0 2 Leicester C Kavanagh Crystal Palace 1 2 Liverpool N Swarbrick Everton 1 3 Man City P Tierney Man United 2 0 Swansea R Madley Newcastle 1 0 Huddersfield M Atkinson Watford 2 2 Bournemouth A Marriner West Brom 1 2 Burnley L Probert West Ham 3 0 Southampton J Moss Arsenal 3 0 Stoke C Pawson Chelsea 1 3 Tottenham A Marriner Bournemouth 2 2 Crystal Palace J Moss Brighton 1 1 Huddersfield A Taylor Everton 0 0 Liverpool M Oliver Leicester 1 2 Newcastle S Attwell Man City 2 3 Man United M Atkinson Stoke 1 2 Tottenham G Scott Watford 1 2 Burnley P Tierney West Brom 1 1 Swansea R East Arsenal 3 2 Southampton A Marriner Chelsea 1 1 West Ham K Friend Burnley 2 1 Leicester M Atkinson Crystal Palace 3 2 Brighton A Marriner Huddersfield 1 0 Watford C Pawson Liverpool 3 0 Bournemouth C Kavanagh Southampton 2 3 Chelsea M Dean Swansea 1 1 Everton L Mason Tottenham 1 3 Man City J Moss Man United 0 1 West Brom P Tierney Newcastle 2 1 Arsenal A Taylor West Ham 1 1 Stoke M Oliver Brighton 1 1 Tottenham K Friend Bournemouth 0 2 Man United G Scott Burnley 1 2 Chelsea R Madley Leicester 0 0 Southampton R East Watford 0 0 Crystal Palace C Kavanagh West Brom 2 2 Liverpool S Attwell Arsenal 4 1 West Ham L Mason Man City 5 0 Swansea C Pawson Stoke 1 1 Burnley M Dean Everton 1 0 Newcastle R Madley Burnley 0 0 Brighton R East Crystal Palace 5 0 Leicester M Dean Huddersfield 0 2 Everton L Probert Liverpool 0 0 Stoke A Marriner Newcastle 0 1 West Brom D Coote Southampton 2 1 Bournemouth A Taylor Swansea 0 1 Chelsea J Moss Man United 2 1 Arsenal K Friend West Ham 1 4 Man City N Swarbrick Tottenham 2 0 Watford M Oliver Brighton 1 0 Man United C Pawson Bournemouth 1 0 Swansea K Friend Everton 1 1 Southampton J Moss Leicester 0 2 West Ham C Kavanagh Stoke 1 2 Crystal Palace M Atkinson Watford 2 1 Newcastle R East West Brom 1 0 Tottenham M Jones Arsenal 5 0 Burnley A Marriner Chelsea 1 0 Liverpool A Taylor Man City 0 0 Huddersfield M Dean Swansea 0 1 Southampton M Oliver Chelsea 1 1 Huddersfield L Mason Leicester 3 1 Arsenal G Scott Man City 3 1 Brighton P Tierney Tottenham 1 0 Newcastle N Swarbrick West Ham 0 0 Man United J Moss Burnley 1 2 Bournemouth P Tierney Crystal Palace 2 0 West Brom J Moss Huddersfield 0 1 Arsenal M Oliver Liverpool 4 0 Brighton K Friend Man United 1 0 Watford L Mason Newcastle 3 0 Chelsea M Atkinson Southampton 0 1 Man City A Marriner Swansea 1 2 Stoke A Taylor Tottenham 5 4 Leicester C Pawson West Ham 3 1 Everton G Scott
print(df[(df.HomeTeam == "Chelsea") | (df.AwayTeam == "Chelsea")])
AC AF AR AS AST AY AwayTeam B365A B365D B365H ... PSCH \ 2 5 11 0 10 5 3 Burnley 15.00 6.50 1.25 ... 1.33 18 3 21 0 9 2 3 Chelsea 3.75 3.60 2.10 ... 2.16 26 3 7 0 7 0 2 Everton 8.50 4.50 1.45 ... 1.53 33 9 8 0 16 6 0 Chelsea 1.80 3.90 4.75 ... 5.00 48 1 15 0 11 2 3 Arsenal 4.50 4.00 1.80 ... 1.77 55 0 14 0 7 4 2 Chelsea 1.62 4.10 6.00 ... 6.65 61 8 13 0 17 6 2 Man City 2.50 3.30 2.75 ... 2.77 71 8 6 0 15 5 1 Chelsea 1.40 5.00 9.00 ... 7.65 81 6 16 0 16 5 3 Watford 10.00 5.25 1.36 ... 1.37 91 5 5 0 18 5 0 Chelsea 1.61 4.20 6.00 ... 6.20 106 7 20 0 10 2 3 Man United 3.20 3.20 2.50 ... 2.62 117 4 12 0 11 7 3 Chelsea 1.61 4.00 6.50 ... 6.92 122 8 7 0 11 3 0 Chelsea 3.50 3.60 2.14 ... 2.21 136 1 7 0 2 0 0 Swansea 17.00 8.00 1.18 ... 1.21 142 4 13 0 8 2 1 Newcastle 15.00 6.50 1.25 ... 1.24 156 3 10 0 19 2 1 Chelsea 1.50 4.50 7.50 ... 7.55 162 3 4 0 12 5 0 Chelsea 1.44 4.50 9.00 ... 9.21 172 4 16 0 6 2 3 Southampton 9.00 5.00 1.39 ... 1.40 183 7 4 0 25 8 0 Chelsea 1.66 3.89 6.00 ... 7.16 191 1 8 0 8 1 1 Brighton 17.00 7.50 1.19 ... 1.17 201 0 10 0 1 1 1 Stoke 19.00 8.50 1.16 ... 1.15 218 8 11 0 19 6 2 Chelsea 2.60 3.39 2.60 ... 3.32 220 3 13 1 14 1 2 Leicester 12.00 5.75 1.30 ... 1.30 231 3 5 0 14 10 0 Chelsea 1.61 3.89 6.50 ... 7.00 243 5 12 0 11 5 0 Bournemouth 11.00 6.50 1.28 ... 1.37 259 2 8 1 7 3 2 Chelsea 1.61 4.00 6.25 ... 6.95 269 7 11 0 8 1 2 West Brom 8.00 4.75 1.36 ... 1.33 278 4 12 0 14 7 2 Chelsea 3.50 3.25 2.29 ... 2.39 288 2 9 0 3 0 1 Chelsea 6.00 4.20 1.61 ... 1.51 290 3 9 0 9 2 2 Crystal Palace 12.00 5.75 1.30 ... 1.29 313 5 11 0 12 7 1 Tottenham 3.10 3.29 2.29 ... 2.30 323 6 11 0 5 2 1 West Ham 12.00 6.00 1.28 ... 1.31 328 7 14 0 17 5 3 Chelsea 1.85 3.75 4.50 ... 4.81 336 2 11 0 16 5 0 Chelsea 1.90 3.39 4.00 ... 4.58 350 2 9 0 11 3 1 Chelsea 1.53 4.33 7.00 ... 7.80 362 1 9 0 10 5 2 Liverpool 3.29 3.60 2.25 ... 2.24 365 0 10 0 3 2 1 Huddersfield 19.00 8.50 1.16 ... 1.25 375 2 10 0 6 2 1 Chelsea 1.60 4.20 6.50 ... 4.85 PSD PSH Referee VCA VCD VCH WHA WHD WHH 2 6.30 1.26 C Pawson 15.00 6.25 1.25 13.00 5.50 1.25 18 3.58 2.08 A Taylor 3.50 3.40 2.05 3.60 3.30 2.10 26 4.55 1.47 J Moss 8.00 4.50 1.45 8.00 4.20 1.44 33 3.83 4.73 L Mason 1.83 3.80 4.60 1.80 3.60 4.33 48 4.02 1.81 M Oliver 4.50 4.00 1.80 4.50 3.50 1.80 55 4.25 5.69 M Dean 1.62 4.10 5.75 1.62 3.60 6.00 61 3.63 2.84 M Atkinson 2.45 3.50 2.80 2.50 3.30 2.80 71 4.92 8.50 A Marriner 1.44 4.60 8.50 1.36 4.80 9.50 81 5.08 1.40 J Moss 9.50 5.25 1.36 9.00 5.00 1.36 91 4.29 5.59 C Pawson 1.65 4.30 5.40 1.62 4.20 5.50 106 3.22 2.54 A Taylor 3.13 3.20 2.50 3.10 3.20 2.50 117 4.09 6.46 J Moss 1.62 4.10 6.25 1.62 3.75 6.50 122 3.68 2.12 M Oliver 3.50 3.60 2.15 3.60 3.30 2.15 136 7.85 1.20 N Swarbrick 21.00 7.50 1.18 17.00 7.00 1.20 142 6.45 1.26 K Friend 15.00 6.25 1.25 13.00 6.00 1.25 156 4.67 7.45 A Taylor 1.50 4.60 7.50 1.50 4.00 7.00 162 4.68 8.36 A Marriner 1.45 4.60 8.50 1.40 4.60 9.00 172 5.10 1.41 R East 10.00 5.00 1.36 9.00 5.00 1.36 183 3.98 5.96 R Madley 1.65 3.90 6.25 1.67 3.80 5.50 191 7.25 1.21 M Dean 20.00 7.00 1.20 15.00 7.00 1.20 201 8.01 1.18 K Friend 17.00 7.50 1.18 17.00 7.00 1.17 218 3.51 2.80 A Taylor 2.63 3.50 2.75 2.70 3.30 2.70 220 5.95 1.30 M Jones 12.00 6.00 1.29 11.00 5.50 1.30 231 3.90 6.33 J Moss 1.62 3.90 6.50 1.62 3.75 6.50 243 6.14 1.30 L Probert 12.00 6.00 1.29 11.00 6.00 1.29 259 4.05 6.15 M Dean 1.62 4.00 6.00 1.62 4.00 6.00 269 5.10 1.40 L Mason 9.50 5.00 1.36 9.00 5.00 1.33 278 3.30 2.30 M Atkinson 3.40 3.30 2.30 3.30 3.10 2.30 288 4.35 1.60 M Oliver 6.00 4.30 1.60 6.00 4.00 1.62 290 6.00 1.30 A Taylor 13.00 5.75 1.29 11.00 5.50 1.30 313 3.40 2.43 A Marriner 3.13 3.40 2.40 3.10 3.20 2.30 323 6.34 1.28 K Friend 12.00 6.00 1.29 12.00 5.50 1.29 328 3.74 4.48 M Dean 1.85 3.70 4.75 1.83 3.60 4.50 336 3.55 4.64 R Madley 1.87 3.50 4.75 1.91 3.40 4.33 350 4.50 7.49 J Moss 1.50 4.33 7.50 1.53 4.00 7.00 362 3.66 2.29 A Taylor 3.25 3.60 2.25 3.40 3.30 2.25 365 7.77 1.19 L Mason 19.00 7.00 1.20 17.00 8.00 1.17 375 4.22 5.96 M Atkinson 1.60 4.20 6.00 1.57 4.00 6.50 [38 rows x 65 columns]
chelsea_homesgames = df.loc[(df.HomeTeam == "Chelsea"), ['HomeTeam', 'FTHG', 'FTAG', 'AwayTeam', ]]
chelsea_awaygames = df.loc[(df.AwayTeam == "Chelsea"), ['HomeTeam', 'FTHG', 'FTAG', 'AwayTeam',]]
print(chelsea_homesgames.to_string(index=False))
print(chelsea_awaygames.to_string(index=False))
HomeTeam FTHG FTAG AwayTeam Chelsea 2 3 Burnley Chelsea 2 0 Everton Chelsea 0 0 Arsenal Chelsea 0 1 Man City Chelsea 4 2 Watford Chelsea 1 0 Man United Chelsea 1 0 Swansea Chelsea 3 1 Newcastle Chelsea 1 0 Southampton Chelsea 2 0 Brighton Chelsea 5 0 Stoke Chelsea 0 0 Leicester Chelsea 0 3 Bournemouth Chelsea 3 0 West Brom Chelsea 2 1 Crystal Palace Chelsea 1 3 Tottenham Chelsea 1 1 West Ham Chelsea 1 0 Liverpool Chelsea 1 1 Huddersfield HomeTeam FTHG FTAG AwayTeam Tottenham 1 2 Chelsea Leicester 1 2 Chelsea Stoke 0 4 Chelsea Crystal Palace 2 1 Chelsea Bournemouth 0 1 Chelsea West Brom 0 4 Chelsea Liverpool 1 1 Chelsea West Ham 1 0 Chelsea Huddersfield 1 3 Chelsea Everton 0 0 Chelsea Arsenal 2 2 Chelsea Brighton 0 4 Chelsea Watford 4 1 Chelsea Man United 2 1 Chelsea Man City 1 0 Chelsea Southampton 2 3 Chelsea Burnley 1 2 Chelsea Swansea 0 1 Chelsea Newcastle 3 0 Chelsea
chelsea_home_wins = chelsea_homesgames.loc[chelsea_homesgames.FTHG > chelsea_homesgames.FTAG]
print(chelsea_home_wins.to_string (index=False))
HomeTeam FTHG FTAG AwayTeam Chelsea 2 0 Everton Chelsea 4 2 Watford Chelsea 1 0 Man United Chelsea 1 0 Swansea Chelsea 3 1 Newcastle Chelsea 1 0 Southampton Chelsea 2 0 Brighton Chelsea 5 0 Stoke Chelsea 3 0 West Brom Chelsea 2 1 Crystal Palace Chelsea 1 0 Liverpool
chelsea_away_wins = chelsea_awaygames.loc[chelsea_awaygames.FTAG > chelsea_awaygames.FTHG]
print(chelsea_away_wins.to_string (index=False))
HomeTeam FTHG FTAG AwayTeam Tottenham 1 2 Chelsea Leicester 1 2 Chelsea Stoke 0 4 Chelsea Bournemouth 0 1 Chelsea West Brom 0 4 Chelsea Huddersfield 1 3 Chelsea Brighton 0 4 Chelsea Southampton 2 3 Chelsea Burnley 1 2 Chelsea Swansea 0 1 Chelsea
chelsea_homesgames = df.loc[(df.HomeTeam == "Chelsea"), ['HomeTeam', 'FTHG', 'FTAG', 'AwayTeam', ]]
chelsea_awaygames = df.loc[(df.AwayTeam == "Chelsea"), ['HomeTeam', 'FTHG', 'FTAG', 'AwayTeam',]]
chelsea_away_losses = chelsea_awaygames.loc[chelsea_awaygames.FTAG < chelsea_awaygames.FTHG]
print(chelsea_away_losses.to_string (index=False))
HomeTeam FTHG FTAG AwayTeam Crystal Palace 2 1 Chelsea West Ham 1 0 Chelsea Watford 4 1 Chelsea Man United 2 1 Chelsea Man City 1 0 Chelsea Newcastle 3 0 Chelsea
chelsea_homesgames = df.loc[(df.HomeTeam == "Chelsea"), ['HomeTeam', 'FTHG', 'FTAG', 'AwayTeam', ]]
chelsea_awaygames = df.loc[(df.HomeTeam == "Chelsea"), ['HomeTeam', 'FTHG', 'FTAG', 'AwayTeam', ]]
chelsea_home_ties = chelsea_homesgames.loc[chelsea_homesgames.FTHG == chelsea_homesgames.FTAG]
chelsea_away_losses = chelsea_awaygames.loc[chelsea_awaygames.FTAG > chelsea_awaygames.FTHG]
print(chelsea_home_ties.to_string (index=False), chelsea_away_losses.to_string (index=False))
HomeTeam FTHG FTAG AwayTeam Chelsea 0 0 Arsenal Chelsea 0 0 Leicester Chelsea 1 1 West Ham Chelsea 1 1 Huddersfield HomeTeam FTHG FTAG AwayTeam Chelsea 2 3 Burnley Chelsea 0 1 Man City Chelsea 0 3 Bournemouth Chelsea 1 3 Tottenham