Analiza kolumn numerycznych
Zidentyfikowano już brakujące wartości i unikalne wpisy w zbiorze danych dotyczącym zapasów sklepu. Teraz czas przyjrzeć się strukturze cen — przeanalizuj kolumnę Unit_Price. Oblicz podstawowe miary statystyczne: minimum, maksimum, średnią i odchylenie standardowe cen produktów.
Pakiety tablesaw zostały już zaimportowane.
To ćwiczenie jest częścią kursu
Czyszczenie danych w Javie
Instrukcje do ćwiczenia
- Wyodrębnij kolumnę
Unit_Price. - Oblicz minimum i maksimum kolumny
Unit_Price. - Oblicz średnią i odchylenie standardowe kolumny
Unit_Price.
Interaktywne ćwiczenie praktyczne
Spróbuj tego ćwiczenia, uzupełniając ten przykładowy kod.
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.____());
}
}