From the course: Advanced Pandas
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Dealing with missing data using pandas
- [Instructor] When you first dive into your dataset, you may be surprised to find that some data simply isn't there at all. How you proceed to treat your data will have important ramifications down the line in your analysis. Let's review some approaches to dealing with missing data in Pandas. First, we'll create a data frame with temperature measurements. Here it is. Note the two missing values in sequence number four. One method to quickly identify all missing values in your data frame is to call isna. This will return true for any cells containing a missing value. Generally, the default parameters in Pandas functions are built to handle null values. For example, sometimes we'll treat nulls as zero and means ignore null values by default. Let's see an example using a cumulative sum down our data frame By default, the cumulative sum skips nulls. Now, if we set, skipna equal to false, the cumulative sum will null all…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.