2

I cannot understand what the to_replace argument of pandas.DataSeries.interpolate method means. The online documentation does not specify this. Here is my session:

>>> import pandas as pd
>>> df = pd.DataFrame({'x': [1.0,1.1,1.2]},index=[1,2,4])
>>> df.interpolate()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: interpolate() takes at least 2 arguments (1 given)
>>> pd.__version__
'0.12.0'
>>> print df.interpolate.__doc__
Interpolate values according to different methods.

        Parameters
        ----------
        to_replace : dict, Series
        method : str
        axis : int
        inplace : bool
        limit : int, default None

        Returns
        -------
        frame : interpolated

        See Also
        --------
        reindex, replace, fillna

>>> import inspect
>>> print inspect.getargspec(df.interpolate)
ArgSpec(args=['self', 'to_replace', 'method', 'axis', 'inplace', 'limit'], varargs=None,  keywords=None, defaults=('pad', 0, False, None))

The online documentation does not mention the DataFrame.interpolate method... and the Series.interpolate method does not have the `to_replace' argument.

Emanuele Paolini
  • 9,912
  • 3
  • 38
  • 64
  • 2
    Take a look at this post: http://stackoverflow.com/questions/10464738/interpolation-on-dataframe-in-pandas – asiviero Jan 06 '14 at 18:05
  • see here for 0.13 usage: (released, just not on pypi yet). http://pandas.pydata.org/pandas-docs/dev/missing_data.html#interpolation – Jeff Jan 06 '14 at 20:47

0 Answers0