数値列の分析
これまでに、食料品在庫データセットの欠損値とユニークな値を確認しました。次は、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.____());
}
}