@Appender(_shared_docs['<STR_LIT>'] % _shared_doc_kwargs)<EOL><INDENT>def interpolate(self, method='<STR_LIT>', axis=<NUM_LIT:0>, limit=None, inplace=False,<EOL>limit_direction='<STR_LIT>', limit_area=None,<EOL>downcast=None, **kwargs):<DEDENT>
inplace = validate_bool_kwarg(inplace, '<STR_LIT>')<EOL>if self.ndim > <NUM_LIT:2>:<EOL><INDENT>raise NotImplementedError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if axis == <NUM_LIT:0>:<EOL><INDENT>ax = self._info_axis_name<EOL>_maybe_transposed_self = self<EOL><DEDENT>elif axis == <NUM_LIT:1>:<EOL><INDENT>_maybe_transposed_self = self.T<EOL>ax = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>_maybe_transposed_self = self<EOL><DEDENT>ax = _maybe_transposed_self._get_axis_number(ax)<EOL>if _maybe_transposed_self.ndim == <NUM_LIT:2>:<EOL><INDENT>alt_ax = <NUM_LIT:1> - ax<EOL><DEDENT>else:<EOL><INDENT>alt_ax = ax<EOL><DEDENT>if (isinstance(_maybe_transposed_self.index, MultiIndex) and<EOL>method != '<STR_LIT>'):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if _maybe_transposed_self._data.get_dtype_counts().get(<EOL>'<STR_LIT:object>') == len(_maybe_transposed_self.T):<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if method == '<STR_LIT>':<EOL><INDENT>index = np.arange(len(_maybe_transposed_self._get_axis(alt_ax)))<EOL><DEDENT>else:<EOL><INDENT>index = _maybe_transposed_self._get_axis(alt_ax)<EOL>methods = {"<STR_LIT:index>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT:time>"}<EOL>is_numeric_or_datetime = (<EOL>is_numeric_dtype(index) or<EOL>is_datetime64_dtype(index) or<EOL>is_timedelta64_dtype(index)<EOL>)<EOL>if method not in methods and not is_numeric_or_datetime:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(method=method))<EOL><DEDENT><DEDENT>if isna(index).any():<EOL><INDENT>raise NotImplementedError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>data = _maybe_transposed_self._data<EOL>new_data = data.interpolate(method=method, axis=ax, index=index,<EOL>values=_maybe_transposed_self, limit=limit,<EOL>limit_direction=limit_direction,<EOL>limit_area=limit_area,<EOL>inplace=inplace, downcast=downcast,<EOL>**kwargs)<EOL>if inplace:<EOL><INDENT>if axis == <NUM_LIT:1>:<EOL><INDENT>new_data = self._constructor(new_data).T._data<EOL><DEDENT>self._update_inplace(new_data)<EOL><DEDENT>else:<EOL><INDENT>res = self._constructor(new_data).__finalize__(self)<EOL>if axis == <NUM_LIT:1>:<EOL><INDENT>res = res.T<EOL><DEDENT>return res<EOL><DEDENT>
Interpolate values according to different methods.