title: Create a matrix 11x3 with 0's and 1' s on each entry depending on the result of the condition, using python
body: <p>I want to create a matrix 11x3 with 0 and 1 and save it as the variable TIME. Each entry in the matrix will execute the following if u[i] &lt; t then will give 1 as an entry else 0.</p>
  
  <p>My code is the following:</p>
  
  <pre><code>u = [1, 3, 9]
  
  ts = [0, 1, 2, 3, 4, 5, 6, 7,  8, 9, 10]
  
  time = np.zeros((len(ts), len(u))) # the size of the matrix 
  for i in range(len(ts)):
      for j in range(len(u)):
          for t in ts:
               if u[j] &lt; t:
                 time [i,j] += 1
               else:
                 time[i,j] += 0
                 print(time[i,j])
  </code></pre>
  
  <p>However I do not get the result I  want. If anyone could help I would be grateful. I want to create a function out of it because I want to use it again later on my code but it does not work .If anyone could help I would be grateful.</p>