@deprecate_kwarg(old_arg_name='<STR_LIT>', new_arg_name='<STR_LIT:value>')<EOL><INDENT>def fillna(self, value=None, method=None, limit=None):<DEDENT>
value, method = validate_fillna_kwargs(<EOL>value, method, validate_scalar_dict_value=False<EOL>)<EOL>if value is None:<EOL><INDENT>value = np.nan<EOL><DEDENT>if limit is not None:<EOL><INDENT>raise NotImplementedError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>codes = self._codes<EOL>if method is not None:<EOL><INDENT>values = self.to_dense().reshape(-<NUM_LIT:1>, len(self))<EOL>values = interpolate_2d(values, method, <NUM_LIT:0>, None,<EOL>value).astype(self.categories.dtype)[<NUM_LIT:0>]<EOL>codes = _get_codes_for_values(values, self.categories)<EOL><DEDENT>else:<EOL><INDENT>if isinstance(value, ABCSeries):<EOL><INDENT>if not value[~value.isin(self.categories)].isna().all():<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>values_codes = _get_codes_for_values(value, self.categories)<EOL>indexer = np.where(values_codes != -<NUM_LIT:1>)<EOL>codes[indexer] = values_codes[values_codes != -<NUM_LIT:1>]<EOL><DEDENT>elif is_hashable(value):<EOL><INDENT>if not isna(value) and value not in self.categories:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>mask = codes == -<NUM_LIT:1><EOL>if mask.any():<EOL><INDENT>codes = codes.copy()<EOL>if isna(value):<EOL><INDENT>codes[mask] = -<NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>codes[mask] = self.categories.get_loc(value)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(type(value).__name__))<EOL><DEDENT><DEDENT>return self._constructor(codes, dtype=self.dtype, fastpath=True)<EOL>
Fill NA/NaN values using the specified method.

Parameters
----------
value : scalar, dict, Series
    If a scalar value is passed it is used to fill all missing values.
    Alternatively, a Series or dict can be used to fill in different
    values for each index. The value should not be a list. The
    value(s) passed should either be in the categories or should be
    NaN.
method : {'backfill', 'bfill', 'pad', 'ffill', None}, default None
    Method to use for filling holes in reindexed Series
    pad / ffill: propagate last valid observation forward to next valid
    backfill / bfill: use NEXT valid observation to fill gap
limit : int, default None
    (Not implemented yet for Categorical!)
    If method is specified, this is the maximum number of consecutive
    NaN values to forward/backward fill. In other words, if there is
    a gap with more than this number of consecutive NaNs, it will only
    be partially filled. If method is not specified, this is the
    maximum number of entries along the entire axis where NaNs will be
    filled.

Returns
-------
filled : Categorical with NA/NaN filled