Challenge: Dropping Null Values
If the dataset has rows with null values, we should consider removing them. In pandas
, this can be achieved using the dropna()
method.
Task
Swipe to start coding
You are given a DataFrame
named wine_data
.
- Get the length of this
DataFrame
before removing null values and assign the result to thelength_before
variable. - Remove rows with null values and store the resulting
DataFrame
inwine_data
. - Get the length of
wine_data
after removing null values and assign the result to thelength_after
variable.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 8