MulaiMulai sekarang secara gratis

Dropping missing data

Now that you've explored the volunteer dataset and understand its structure and contents, it's time to begin dropping missing values.

In this exercise, you'll drop both columns and rows to create a subset of the volunteer dataset.

Latihan ini adalah bagian dari kursus

Preprocessing for Machine Learning in Python

Lihat Kursus

Petunjuk latihan

  • Drop the Latitude and Longitude columns from volunteer, storing as volunteer_cols.
  • Subset volunteer_cols by dropping rows containing missing values in the category_desc, and store in a new variable called volunteer_subset.
  • Take a look at the .shape attribute of volunteer_subset, to verify it worked correctly.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Drop the Latitude and Longitude columns from volunteer
volunteer_cols = ____

# Drop rows with missing category_desc values from volunteer_cols
volunteer_subset = ____

# Print out the shape of the subset
print(____.____)
Edit dan Jalankan Kode