title: Python Dataframe Compute Min and Max for list of elements
body: <p>I have a big dataframe with 2000 rows, two columns, each column row consisting a list with around 1000 points. I want to drop negative values in both columns together and then compute min and max.
  Presently I am doing through <code>for</code> loop and it is taking 30 minutes to complete. Can I do the same operation through vectorized operations?</p>
  <p>Expected solution approach:</p>
  <pre><code>df = pd.DataFrame({'x':[[-1,0,1,2,10],[1.5,2,4,5]],'y':[[2.5,2.4,2.3,1.5,0.1],[5,4.5,3,-0.1]]})
  df = 
                     x                          y
  0  [-1, 0, 1, 2, 10]  [2.5, 2.4, 2.3, 1.5, 0.1] 
  1     [1.5, 2, 4, 5]          [5, 4.5, 3, -0.1]
  ### x, y are paired data coming from field. Ex, (-1,2.5), (0,2.4)
  # First step: drop negative values in both x and y columns. 
  # Find a negative x or y and drop the pair.
  # Ex, in first row, drop (-1,2.5) pair. That is, -1 in x and 2.5 in y.
  # After dropping negative values
  df = 
           x                          y
  0  [0, 1, 2, 10]  [2.4, 2.3, 1.5, 0.1] 
  1     [1.5, 2, 4]          [5, 4.5, 3]
  
  ### Setp2: Find Max in each column
  df = 
             x                  y               xmax    ymax
  0     [0, 1, 2, 10]  [2.4, 2.3, 1.5, 0.1]      10      2.4
  1     [1.5, 2, 4]    [5, 4.5, 3]               4       5
  
  ### Setp3: Find y@xmax, x@ymax in each column
  df = 
             x                  y               xmax    ymax   y@xmax   x@ymax
  0     [0, 1, 2, 10]  [2.4, 2.3, 1.5, 0.1]      10      2.4     0.1      0
  1     [1.5, 2, 4]    [5, 4.5, 3]               4       5       3        1.5
  </code></pre>
  <p>Present solution: It is working but it is taking huge time.</p>
  <pre><code>for i in range(len(df)):
     ### create an auxiliary dataframe
     auxdf = pd.DataFrame({'x':df['x'].loc[i],'y':df['y'].loc[i]})
     ## Step1: drop negative values
     auxdf = auxdf[(auxdf['x']&gt;0)&amp;(auxdf['y']&gt;0)]
     ### Step2: Max in x and y
     xmax = auxdf['x'].max()
     ymax = auxdf['y'].max()
     ### Step3: x@ymax, y@xmax
     xatymax = auxdf['x'].loc[auxdf['y'].idxmax()]
     yatxmax = auxdf['y'].loc[auxdf['x'].idxmax()]
     ### finally I append xmax,ymax,xatymax,yatxmax to the df
  </code></pre>
  <p>Doing this vectorized operation will minimize the time?</p>