title: How to define a large list array in Python using For loop or Vectorization?
body: <p>I have a 2D list of 416 rows, each row having 4 columns.  Rows 1-4 contain their row number 4 times (i.e., <code>[...[1,1,1,1],[2,2,2,2]...]</code>.  Row 330 contains <code>[41,22,13,13]</code>.  Everything else is <code>[0,0,0,0]</code>.  Currently I am using a for loop with many explicit if statements.  </p>
  
  <pre><code>myList = [[0,0,0,0]]
  for i in range(1, 416):
      if i == 1 or i == 2 or i == 3 or i == 4:
          myList.append([i,i,i,i])
      elif i == 330:
          myList.append([41,22,13,13])
      else:
          myList.append([0,0,0,0])
  </code></pre>
  
  <p>What is a more efficient way for me to define this array?</p>
  
  <p>The other questions I have seen on SO don't seem to explicitly address this question, but if someone finds one that can be considered a duplicate please mark this question as such and I will accept it.</p>