0

NaN share Pandas error

Task:Explore the share of NaNs for each of the given columns. Print these values import pandas as pd import numpy as np data = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/10db3746-c8ff-4c55-9ac3-4affa0b65c16/titanic.csv') cols = ['Cabin', 'Embarked'] print(data['Cabin'].isna().sum()/len(data['Cabin'])) print(data['Embarked'].isna().sum()/len(data['Embarked'])) The last 2 lines are by me. Help, where the errors are?

1st Aug 2022, 8:13 AM
LI HAN
LI HAN - avatar
1 Antwort
+ 1
You can link your code like this: Go to Code section, click +, select the programming language, insert your code, save. Come back to this thread, click +, Insert Code, sort for My Code Bits, select your code. If it is a sololearn task, please mention course name and task number.
1st Aug 2022, 9:30 AM
Lisa
Lisa - avatar