From the course: Exploring Data Science with .NET using Polyglot Notebooks & ML.NET

Unlock this course with a free trial

Join today to access over 24,400 courses taught by industry experts.

Dropping missing values

Dropping missing values

- [Instructor] In the last video, we discussed replacing null values with a replacement value such as zero or the mean or median value. That's often a good strategy, but sometimes you'll want to remove rows entirely that have any null values present. We can detect these values with a filter statement, which we'll cover in a future video, but this filter statement is going to show us any row that has a null quantity. And we can see we have three rows that have null quantities. We scroll over. We see these three rows have null quantities, discounts and totals. If we wanted to, we could remove these rows by calling the data frames DropNulls method. And this is going to return a new data frame, so I'm going to assign that back to my original data frame. Now, if I run the same filter statement afterwards, it should show me that I have no rows that have a missing quantity, discount or total. And we see here that we have reduced those values. Now, this actually removed those rows from my…

Contents