pydata/pandas — pull request #7553 by jdreaver (2014-06-23 18:11:36+00:00)
Title: DOC: fix docstring for DataFrame.interpolate

In the old docstring, `'index'` is listed as a valid value for the `method` kwarg for `DataFrame.interpolate`. It looks like a typo, because there was no comma after `'index'`, and the explanation for `'index'` corresponded to `'values'`. Furthermore, it appears `'index'` is not a valid value for `method`:

```python
In [67]: df = pd.DataFrame([[1], [2], [np.nan], [3]], index=[0, 0.7, 1.1, 4])

In [68]: df
Out[68]:
0
0.0 1
0.7 2
1.1 NaN
4.0 3

In [69]: df.interpolate(method="index")
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
----> 1 df.interpolate(method="index")

/home/david/miniconda3/envs/frackoptima/lib/python3.4/site-packages/pandas/core/generic.py in interp
olate(self, method, axis, limit, inplace, downcast, **kwargs)
2580 inplace=inplace,
2581 downcast=downcast,
-> 2582 **kwargs)
2583 if inplace:
2584 if axis == 1:

/home/david/miniconda3/envs/frackoptima/lib/python3.4/site-packages/pandas/core/internals.py in inte
rpolate(self, **kwargs)
2195
2196 def interpolate(self, **kwargs):
-> 2197 return self.apply('interpolate', **kwargs)
2198
2199 def shift(self, **kwargs):

/home/david/miniconda3/envs/frackoptima/lib/python3.4/site-packages/pandas/core/internals.py in appl
y(self, f, axes, filter, do_integrity_check, **kwargs)
2162 copy=align_copy)
2163
-> 2164 applied = getattr(b, f)(**kwargs)
2165
2166 if isinstance(applied, list):

/home/david/miniconda3/envs/frackoptima/lib/python3.4/site-packages/pandas/core/internals.py in inte
rpolate(self, method, axis, index, values, inplace, limit, fill_value, coerce, downcast, **kwargs)
667 **kwargs)
668
--> 669 raise ValueError("invalid method '{0}' to interpolate.".format(method))
670
671 def _interpolate_with_fill(self, method='pad', axis=0, inplace=False,

ValueError: invalid method 'index' to interpolate.

In [70]: df.interpolate(method="values")
Out[70]:
0
0.0 1.000000
0.7 2.000000
1.1 2.121212
4.0 3.000000
```