BaşlayınÜcretsiz başlayın

Advanced missing data

In the previous exercise, you saw how to identify how many missing values are in each column of a DataFrame, and then you can simply drop any rows that have missing values. However, what if there are a lot of rows with missing values? What if you don't simply want to start deleting rows from the data? This is where the concept of replacement comes in - you can replace the missing values with something else.

In this exercise, you will work with the same sales_df DataFrame as in the last exercise, but instead of dropping missing values, you will replace the missing values in each column with the average of all non-missing values. You will write a function that can then be applied to any column in a DataFrame.

Bu egzersiz, kursun bir parçasıdır

Intermediate Julia

Kursa Göz Atın

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Define a function replace_missing that takes one argument, the name of the column we want to modify
____ replace_missing(____)
end
Kodu Düzenle ve Çalıştır