BaşlayınÜcretsiz Başlayın

Center and scale manually

We've loaded the same dataset named data. Now your goal will be to center and scale them manually.

Libraries pandas, numpy, seaborn and matplotlib.pyplot have been loaded as pd, np, sns and plt respectively. Feel free to explore the dataset in the console.

Bu egzersiz

Customer Segmentation in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Center the data by subtracting average values from each entry.
  • Scale the data by dividing each entry by standard deviation.
  • Combine two above actions and normalize the data by applying both centering and scaling.
  • Print summary statistics to make sure average is zero and standard deviation is one, and round the output to 2 decimals.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Center the data by subtracting average values from each entry
data_centered = data - data.____()

# Scale the data by dividing each entry by standard deviation
data_scaled = ____ / ____.____()

# Normalize the data by applying both centering and scaling
data_normalized = (____ - data.____()) / data.____()

# Print summary statistics to make sure average is zero and standard deviation is one
print(data_normalized.____().round(____))
Kodu Düzenle ve Çalıştır