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

Finding outliers with cross tables

Now you need to find and remove outliers you suspect might be in the data. For this exercise, you can use cross tables and aggregate functions.

Have a look at the person_emp_length column. You've used the aggfunc = 'mean' argument to see the average of a numeric column before, but to detect outliers you can use other functions like min and max.

It may not be possible for a person to have an employment length of less than 0 or greater than 60. You can use cross tables to check the data and see if there are any instances of this!

The data set cr_loan has been loaded in the workspace.

Bu egzersiz

Credit Risk Modeling in Python

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

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create the cross table for loan status, home ownership, and the max employment length
print(pd.____(cr_loan[____],cr_loan[____],
        values=cr_loan[____], aggfunc=____))
Kodu Düzenle ve Çalıştır