开始使用免费开始使用

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 rating column by the column median, mutating the original DataFrame.

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Replace missing values in rating column by median
____(____, ____ => ____(____(____)))

println(describe(chocolates, :nmissing))
编辑并运行代码