title: Python - best way to set a column in a 2d array to a specific value
body: <p>I have a 2d array, I would like to set a column to a particular value, my code is below. Is this the best way in python?</p>
  
  <pre><code>rows = 5
  cols = 10
  
  data = (rows * cols) *[0]
  val = 10
  set_col = 5
  
  for row in range(rows):
      data[row * cols + set_col - 1] = val
  </code></pre>
  
  <p>If I want to set a number of columns to a particular value , how could I extend this</p>
  
  <p>I would like to use the python standard library only</p>
  
  <p>Thanks</p>