Lec 4
Lec 4
• The ffill() and bfill() functions copy forward the data from the
previous row (forward fill) or copy the value from the next row
(backward fill).
5
Imputing Missing Values
• Fill Missing Price values with mean price::
• Fill Missing user_type values with value from previous row (forward fill) ::
• Fill Missing user_type values with value from next row (backward fill) ::
11
12
Handling Categorical Data
• The second method is to convert the categorical variable
into indicator variables using the get_dummies() function.