mercredi 8 avril 2020

How to assign points to scores, such as 3 for a win and 1 for a draw?

 def calcscore():

 if FTHG > FTAG:
    POINTS[HomeTeam] == 3
     if  FTHG == FTAG:
        POINTS[Hometeam] == 1
        POINTS[Awayteam] == 1
        else:
            POINTS[AwayTeam] == 3
            return pandas.Series(POINTS, index=prem.index) 
       calcscore()

Hi, I am new to coding and am trying a premier league dataset and am trying to assign scores to points for the home and away teams but keep getting syntax or indenting errors. Why is this and how would I write it in order for it to work thank you, I have spent hours on this. The top of the dataset is below.

        Div        Date   Time        HomeTeam          AwayTeam  FTHG  FTAG 
      FTR  \
   0    E0  09/08/2019  20:00       Liverpool           Norwich     4     1   H   
   1    E0  10/08/2019  12:30        West Ham          Man City     0    5   A   

Aucun commentaire:

Enregistrer un commentaire