What Series method replaced searchsorted?
pandas, python
Solution
I believe this is due to the refactoring that occurred in Pandas 0.13.0 where Pandas Series now sub-class NDFrame rather than ndarray see this:
In [33]:
import pandas as pd
import numpy as np
df = pd.DataFrame({'a':arange(10)})
df
Out[33]:
a
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
[10 rows x 1 columns]
[10 rows x 3 columns]
In [28]:
# you now have to call `.values` to return a ndarray
df.a.values.cumsum().searchsorted(11)
Out[28]:
5
Now compare what happens if we use a numpy array:
In [29]:
temp = np.array(arange(10))
In [32]:
temp.cumsum().searchsorted(11)
Out[32]:
5
Problem
In his video, [Data analysis in Python with pandas] (http://youtu.be/w26x-z-BdWQ?t=2h14s), Wes McKinney presents a series method names searchsorted(), which given a value, gives back the index in which the series is crossing that value. It appears this function is not available any more, did something else replace it?