title: Numpy automatic elementwise function
body: <p>I have a question regarding numpy. </p>
  
  <p>Let's assume I have a function </p>
  
  <pre><code>def calcSomething(A,t):
  
      return t*A
  </code></pre>
  
  <p>I want to pass A a constant numpy-array, e.g. <code>A=np.array([1.0,2.0])</code> and t as equidistant points, e.g. <code>t = np.linspace(0.0,1.0,10)</code>.
  Now, when I execute </p>
  
  <pre><code>x = calcSomething(A,t)
  </code></pre>
  
  <p>I'd like to get <code>x[0] = [0,0]</code>, <code>x[1] = [.1,.2]</code>,...,<code>x[9] = [1.0,2.0]</code>. Is there an easy way to achieve that, or do I have to implement it using for-loops and appending?</p>
  
  <p>Edit: 'calcSomething(): is just a placeholder for a more complex function. </p>
  
  <p>E.g. <code>y=np.sin(t)</code> yields <code>y[i]=np.sin(t[i])</code>. That's what I want to achieve for a generic function. </p>
  
  <p>Thanks in advance!</p>