title: Generate numpy array using multiple columns of pandas dataframe
body: <p>Sorry for the long post.
  I'm using python 3.6 on windows 10.I have a pandas data frame that contain around 100,000 rows. From this data frame I need to generate Four numpy arrays. First 5 relevant rows of my data frame looks like below</p>
  
  <pre><code>A          B      x      UB1     LB1     UB2    LB2
  0.2134  0.7866  0.2237  0.1567  0.0133  1.0499  0.127
  0.24735 0.75265 0.0881  0.5905  0.422   1.4715  0.5185
  0.0125  0.9875  0.1501  1.3721  0.5007  2.0866  2.0617
  0.8365  0.1635  0.0948  1.9463  1.0854  2.4655  1.9644
  0.1234  0.8766  0.0415  2.7903  2.2602  3.5192  3.2828
  </code></pre>
  
  <p>Column B is (1-Column A), Actually column B is not there in my data frame. I have added it to explain my problem 
  From this data frame, I need to generate three arrays. My arrays looks like</p>
  
  <pre><code>My array c looks like array([-0.2134, -0.7866,-0.24735, -0.75265,-0.0125, -0.9875,-0.8365, -0.1635,-0.1234, -0.8766],dtype=float32)
  </code></pre>
  
  <p>Where first element is first row of column A with added negative sign, similarly 2nd element is taken from 1st row of column B, third element is from second row of column A,fourth element is 2nd row of column B &amp; so on
  My second array UB looks like </p>
  
  <pre><code>array([ 0.2237, 0.0881, 0.1501, 0.0948, 0.0415, 0.2237],dtype=float32)
  </code></pre>
  
  <p>where elements are rows of column X.</p>
  
  <p>My third array,bounds, looks like</p>
  
  <pre><code>   array([[0.0133 , 0.1567],
         [0.127 , 1.0499],
         [0.422 , 0.5905],
         [0.5185 , 1.4715],
         [0.5007 , 1.3721],
         [2.0617 , 2.0866],
         [1.0854 , 1.9463],
         [1.9644 , 2.4655],
         [2.2602 , 2.7903],
         [3.2828 , 3.5192]])
  </code></pre>
  
  <p>Where bounds[0][0] is first row of LB1,bounds[0][1] is first row of UB1. bounds[1][0] is first row of LB2, bounds [1][1] is first row of UB2. Again bounds[2][0] is 2nd row of LB1 &amp; so on. 
  My fourth array looks like</p>
  
  <pre><code>array([[-1,  1,  0,  0,  0,  0,  0,  0,  0,  0],
         [ 0,  0, -1,  1,  0,  0,  0,  0,  0,  0],
         [ 0,  0,  0,  0, -1,  1,  0,  0,  0,  0],
         [ 0,  0,  0,  0,  0,  0, -1,  1,  0,  0],
         [ 0,  0,  0,  0,  0,  0,  0,  0, -1,  1]])
  </code></pre>
  
  <p>It contains same number of rows as data frame rows &amp; column=2*data frame rows.</p>
  
  <p>Can you please tell me for 100,000 rows of record what is the efficient way to generate these arrays</p>