Course Content
Preprocessing Data
Preprocessing Data
Replace Missing Values with Interpolation
Another approach to deal with numerical data is using interpolation. Each NaN value will be replaced with the result of interpolation between the previous and the next entry over the column. Let's apply the interpolate()
function to numeric column Age
by setting the limit direction to forward. This means that linear interpolation is applied from the first line to the last.
data = data.interpolate(method = 'linear', limit_direction = 'forward')
Task
Fill the empty places in the code. Compare the data in Age
column before and after using interpolation (look at the last 10 rows).
Thanks for your feedback!
Replace Missing Values with Interpolation
Another approach to deal with numerical data is using interpolation. Each NaN value will be replaced with the result of interpolation between the previous and the next entry over the column. Let's apply the interpolate()
function to numeric column Age
by setting the limit direction to forward. This means that linear interpolation is applied from the first line to the last.
data = data.interpolate(method = 'linear', limit_direction = 'forward')
Task
Fill the empty places in the code. Compare the data in Age
column before and after using interpolation (look at the last 10 rows).
Thanks for your feedback!
Replace Missing Values with Interpolation
Another approach to deal with numerical data is using interpolation. Each NaN value will be replaced with the result of interpolation between the previous and the next entry over the column. Let's apply the interpolate()
function to numeric column Age
by setting the limit direction to forward. This means that linear interpolation is applied from the first line to the last.
data = data.interpolate(method = 'linear', limit_direction = 'forward')
Task
Fill the empty places in the code. Compare the data in Age
column before and after using interpolation (look at the last 10 rows).
Thanks for your feedback!
Another approach to deal with numerical data is using interpolation. Each NaN value will be replaced with the result of interpolation between the previous and the next entry over the column. Let's apply the interpolate()
function to numeric column Age
by setting the limit direction to forward. This means that linear interpolation is applied from the first line to the last.
data = data.interpolate(method = 'linear', limit_direction = 'forward')
Task
Fill the empty places in the code. Compare the data in Age
column before and after using interpolation (look at the last 10 rows).