MulaiMulai sekarang secara gratis

Missing value imputation

As the majority of the real world data contain missing entries, replacing these entries with sensible values can increase the insight you can get from our data.

In the restaurant dataset, the "total_bill" column has some missing entries, meaning that you have not recorded how much some tables have paid. Your task in this exercise is to replace the missing entries with the median value of the amount paid, according to whether the entry was recorded on lunch or dinner (time variable).

Latihan ini adalah bagian dari kursus

Writing Efficient Code with pandas

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Define the lambda function
missing_trans = ____ x: x.____(x.____())
Edit dan Jalankan Kode