I have a dataframe column which could look something like this:
s = pd.Series(["a0a1a3", "b1b3", "c1c1c3c3"], index=["A", "B", "C"])
I can find the str.find method to find at each cell the indeces I want:
s.str.find('1').values
array([3, 1, 1])
s.str.find('3').values
array([5, 3, 5])
However I cannot find how to use these function to cut a strings in that column. For example:
s.str[s.str.find('1').values:s.str.find('3').values].values
gives
array([ nan, nan, nan])
Which is the right way to combine these functions?