开始使用免费开始使用

数值列分析

您已经识别了杂货库存数据集中的缺失值和唯一条目。现在,您需要通过分析 Unit_Price 列来了解库存中的定价模式。请计算商品价格的基本统计量,如最小值、最大值、均值和标准差。

已为您导入 tablesaw 包。

本练习是课程的一部分

Java 数据清洗

查看课程

练习说明

  • 提取 Unit_Price 列。
  • 计算 Unit_Price 的最小值和最大值。
  • 计算 Unit_Price 的均值和标准差。

交互式实操练习

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

public class GroceryDataQuality {
    public static void main(String[] args) {
        Table inventory = Table.read().csv("grocery_inventory.csv");

        // Extract the unit price column
        DoubleColumn price = ____.____("Unit_Price");
        System.out.println("Stock Quantity Statistics:");

        // Compute the min and max of unit price
        System.out.println("Min: " + price.____());
        System.out.println("Max: " + price.____());

        // Compute the mean and standard deviation of the unit price
        System.out.println("Mean: " + price.____());
        System.out.println("Standard deviation: " + price.____());
    }
}
编辑并运行代码