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

Checking for missing values

Identifying missing values is important for analysis. Using the same dataset, you will get the total number of missing values by iterating over both rows and columns within the dataset. Subject to finding missing values, further methods are needed to handle such values, such as using Imputer from sklearn. Missing values need to be handled, otherwise it will be difficult to conduct proper CTR prediction.

Sample data in DataFrame form is loaded as df. pandas as pd is also available in your workspace.

Bu egzersiz

Predicting CTR with Machine Learning in Python

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

Egzersiz talimatları

  • Print a basic summary of columns using .info().
  • Print the missing values by columns, using .isnull() (don't forget the parentheses!).
  • Print the total number of missing values by rows using axis = 1 and the .sum().

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Print info
print(df.____)

# Print missing values by column 
print(df.____.sum(____ = 0))

# Print total number of missing values in rows
print(df.____.sum(____ = 1).____)
Kodu Düzenle ve Çalıştır