title: Vectorized indexing numpy arrays in pandas Series with Boolean numpy arrays in pandas Series
body: <p>The following reproducible code produces an example data set that mimics my data on a much smaller scale. </p>
  
  <pre><code>import numpy as np 
  import pandas as pd
  
  np.random.seed(142536)
  
  df = pd.DataFrame({
          "vals": list(np.arange(12).reshape(3,4)),
          "idx" : list(np.random.choice([True, False], 12).reshape(3,4))})
  df
  </code></pre>
  
  <p></p>
  
  <pre><code>                           idx            vals
  0   [False, True, True, False]    [0, 1, 2, 3]
  1    [True, True, False, True]    [4, 5, 6, 7] 
  2  [False, True, False, False]  [8, 9, 10, 11] 
  </code></pre>
  
  <p>The following reproducible code returns the results I want, but is very inefficient for large data sets.<br>
  How would I do this more efficiently?</p>
  
  <pre><code>sel = []
  for i in range(len(df.vals)):
      sel.append(df.vals[i][df.idx[i]])
  
  df['sel'] = sel
  df
  </code></pre>
  
  <p></p>
  
  <pre><code>                           idx            vals        sel
  0   [False, True, True, False]    [0, 1, 2, 3]     [1, 2]
  1    [True, True, False, True]    [4, 5, 6, 7]  [4, 5, 7]
  2  [False, True, False, False]  [8, 9, 10, 11]        [9]
  </code></pre>
  
  <p>I have tried <code>np.apply_along_axis()</code>, <code>np.where()</code>, <code>df.apply()</code>, and <code>df.transform()</code>, but can't get any of them to work for this case without errors.</p>