Course Content
Pandas First Steps
Pandas First Steps
2. Reading Files in Pandas
3. Analyzing the Data
Viewing the DataQuiz: Using HeadQuiz: Head, Tail, and SampleExploring the DatasetColumn Names and Data TypesFinding Null ValuesQuiz: Identifying Null ValuesChallenge: Dropping Null ValuesChallenge: Filling Null ValuesQuiz: Null ValuesDescribing the Datamax() and min()Quiz: Statistical Operationssum() and count()Unique Values
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 show code editor
- Find the length of
wine_data
before removing null values and assign the result to thelength_before
variable. - Remove rows with null values.
- Find the length of
wine_data
after removing null values and assign the result to thelength_after
variable. - Print the number of removed rows based on the
length_before
andlength_after
variables.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 3. Chapter 8
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 show code editor
- Find the length of
wine_data
before removing null values and assign the result to thelength_before
variable. - Remove rows with null values.
- Find the length of
wine_data
after removing null values and assign the result to thelength_after
variable. - Print the number of removed rows based on the
length_before
andlength_after
variables.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 3. Chapter 8
Switch to desktop for real-world practiceContinue from where you are using one of the options below