LoslegenKostenlos loslegen

Imputing and filling in missing values using averages

When you want to do your analysis, you will likely use your own data. Datasets often have some missing values. In this exercise, you'll practice imputing these missing values. Imputing missing values is important as you do not want missing values to be an obstacle in our analysis.

pandas has been loaded with the alias pd and NumPy has been loaded with the alias np. A pandas DataFrame called dataset has been loaded for you. It has the column "Total Current Liabilities", which has some missing values in it.

Diese Übung ist Teil des Kurses

Analyzing Financial Statements in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Impute missing value using average non-missing values by company
impute_by_company = dataset.____

# Impute missing value using average non-missing values by industry
impute_by_comp_type = dataset.____

print(impute_by_company)
print(impute_by_comp_type)
Code bearbeiten und ausführen