title: Extract substring in dataframe based on start and stop indexes positions defined in two other columns
body: <pre><code>df=  "start", "stop", "Seq"
     50       121   aaaaaaaaaaaaabbbbbbbbbbbbcccccccccc...dddddd
     25       150   aaaaahhhhhhhssssssssssssssccccccccc...dddddd
  </code></pre>
  
  <p>I need to extract a substring in column "Seq" of the dataframe(df) using str.slice(start=start, stop=stop) using as start and stop values the values in a columns named "start" and "stop" (for each of the rows of the dataframe).</p>
  
  <p>I would like to use a def function or lambda but I get errors</p>
  
  <pre><code>def f(x,y,z):
  return z.str.slice(start=x, stop=y)
  df.apply(lambda x: f(x["start"],x["stop"],x["Seq"]))
  </code></pre>
  
  <p>Output:
  KeyError: ('start', 'occurred at index id')</p>