title: How do I add a column with a repeating series of values to a dataframe?
body: <p>I would like a add a column with a repeating series values to a dataframe with the each value in the list being repeated a set number of times, for example:</p>
  <pre><code>   x   y  z
     0   2  1
     2  15  1
     0  10  2
     2  20  2
     0  30  3
     2  50  3
  </code></pre>
  <p>Where each value in z is repeated twice.</p>
  <p>So far I have this which repeats the whole list rather than each item in the list a set number of times:</p>
  <pre><code>data = [[0, 2], [2, 15], [0, 10], [2, 20], [0, 30], [2, 50]]
  df1 = pd.DataFrame(data, columns = ['x', 'y'])
  
  df1['z']=0
  np.put(df1['z'], np.arange(len(df1)), [1, 2])
  print(df1)
  </code></pre>
  <p>Result:</p>
  <pre><code>x   y  z
  0   2  1
  2  15  2
  0  10  3
  2  20  1
  0  30  2
  2  50  3
  </code></pre>
  <p>How can specifiy the number of times to repeat each item in the list rather than repeating the whole list? Also, Ideally it would be great if the solution could be applied to strings as well as integers, many thanks!</p>