title: creating a range of numbers in pandas based on single column
body: <p>I have a pandas dataframe:</p>
  <pre><code>df2 = pd.DataFrame({'ID':['A','B','C','D','E'], 'loc':['Lon','Tok','Ber','Ams','Rom'], 'start':[20,10,30,40,43]})
  
  
      ID  loc     start
  0   A   Lon     20
  1   B   Tok     10
  2   C   Ber     30
  3   D   Ams     40
  4   E   Rom     43
  </code></pre>
  <p>I'm looking to add in a column called range which takes the value in 'start' and produces a range of values which (including the initial value) are 10 less than the initial value, all in the same row.</p>
  <p>The desired output:</p>
  <pre><code>    ID  loc     start    range
  0   A   Lon     20       20,19,18,17,16,15,14,13,12,11,10
  1   B   Tok     10       10,9,8,7,6,5,4,3,2,1,0
  2   C   Ber     30       30,29,28,27,26,25,24,23,22,21,20
  3   D   Ams     40       40,39,38,37,36,35,34,33,32,31,30
  4   E   Rom     43       43,42,41,40,39,38,37,36,35,34,33
  </code></pre>
  <p>I have tried:</p>
  <pre><code>df2['range'] = [i for i in range(df2.start, df2.start -10)]
  </code></pre>
  <p>and</p>
  <pre><code>def create_range2(row):
    
    return df2['start'].between(df2.start, df2.start - 10)
    
  
  df2.loc[:, 'range'] = df2.apply(create_range2, axis = 1)
  </code></pre>
  <p>however I can't seem to get the desired output. I intend to apply this solution to multiple dataframes, one of which has &gt; 2,000,000 rows.</p>
  <p>thanks</p>