title: numpy: how to apply function to every row of array
body: <p>I have a 2d numpy array called <code>my_data</code>. Each row represents information about one data point and each column represents different attributes of that data point.</p>
  
  <p>I have a function called processRow. It takes in a row, and does some processing on the info and returns the modified row. The length of the row returned by the function is longer than the row taken in by the function (the function basically expands some categorical data into one-hot vectors)</p>
  
  <p>How can I have a numpy array where every row has been processed by this function?</p>
  
  <p>I tried</p>
  
  <pre><code>answer = np.array([])
  for row in my_data:
      answer = np.append(answer,processRow(row))
  </code></pre>
  
  <p>but at the end, the answer is just a single really long row rather than a 2d grid</p>