Challenge: Dropping Null Values
If a dataset contains rows with null values, consider removing them. In pandas, you can do this using the dropna() method.
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 17
single
Challenge: Dropping Null Values
Swipe to show menu
If a dataset contains rows with null values, consider removing them. In pandas, you can do this using the dropna() method.
Task
Swipe to start coding
You are given a DataFrame named wine_data.
- Get the length of this
DataFramebefore removing null values and assign the result to thelength_beforevariable. - Remove rows with null values and store the resulting
DataFrameinwine_data. - Get the length of
wine_dataafter removing null values and assign the result to thelength_aftervariable.
Solution
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 17
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat