Replacing rating with median
Oh no! The chocolates dataset got corrupted, and the rating column now contains missing values… You don't want to drop the missing values altogether, so you need to replace them with something. Let's try the median of the column! Maybe you'll implement a better way in the future, but for now, it will do.
The chocolates dataset and the DataFrames and Statistics packages have been loaded for you.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Data Manipulation in Julia
คำแนะนำการฝึกหัด
- Replace missing values in
ratingcolumn by the column median, mutating the original DataFrame.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Replace missing values in rating column by median
____(____, ____ => ____(____(____)))
println(describe(chocolates, :nmissing))