<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fillna(self, value):
 """Returns DataFrame with missing values replaced with value. Parameters value : {int, float, bytes, bool} or dict Scalar value to replace missing values with. If dict, replaces missing values only in the key columns with the value scalar. Returns ------- DataFrame With missing values replaced. """

        if is_scalar(value):
            new_data = OrderedDict((column.name, column.fillna(value))
                                   for column in self._iter())

            return DataFrame(new_data, self.index)
        elif isinstance(value, dict):
            new_data = OrderedDict((column.name, column.fillna(value[column.name]) if column.name in value else column)
                                   for column in self._iter())

            return DataFrame(new_data, self.index)
        else:
            raise TypeError('Can only fill na given a scalar or a dict mapping columns to their respective scalar')