title: Appending variable length columns in Pandas dataframe Python
body: <p>I have a few csv files which contain a pair of bearings for many locations. I am trying to expand the values to include every number between the bearing pairs for each location and export the variable lengths as a csv in the same format. </p>
  
  <p>Example:</p>
  
  <pre><code>df = pd.read_csv('bearing.csv')
  </code></pre>
  
  <p>Data structure:</p>
  
  <pre><code>     A         B           C         D           E            
  0    0         94          70        67          84       
  1    120       132         109       152         150          
  </code></pre>
  
  <p>Ideal result is a variable length multidimensional array:</p>
  
  <pre><code>     A         B           C         D           E            
  0    0         94          70        67          84       
  1    1         95          71        68          85  
  2    3         96          72        69          86
  ...
  n    120       132         109       152         150
  </code></pre>
  
  <p>I am looping through each column and getting the range of the pair of values, but I am struggling when trying to overwrite the old column with the new range of values.</p>
  
  <pre><code>for col in bear:
      min_val = min(bear[col])
      max_val = max(bear[col])
      range_vals = range(min(bear[col]), max(bear[col])+1)
      bear[col] = range_vals
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code> ValueError: Length of values does not match length of index
  </code></pre>