lundi 2 août 2021

In the below code I was unable to understand why line 2 and line 3 was used [closed]

def impute_age(cols):
    Age = cols[0]         //Line1
    Pclass = cols[1]      //Line 2
    
    if pd.isnull(Age):

        if Pclass == 1:
            return 37

        elif Pclass == 2:
            return 29

        else:
            return 24

    else:
        return Age

Aucun commentaire:

Enregistrer un commentaire