title: Equivalent of j in NumPy
body: <p>What is the equivalent of Octave's <code>j</code> in NumPy? How can I use <code>j</code> in Python?</p>
  
  <p>In Octave:</p>
  
  <pre><code>octave:1&gt; j
  ans =  0 + 1i
  octave:1&gt; j*pi/4
  ans =  0.00000 + 0.78540i
  </code></pre>
  
  <p>But in Python:</p>
  
  <pre><code>&gt;&gt;&gt; import numpy as np
  &gt;&gt;&gt; np.imag
  &lt;function imag at 0x2368140&gt;
  &gt;&gt;&gt; np.imag(3)
  array(0)
  &gt;&gt;&gt; np.imag(3,2)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: imag() takes exactly 1 argument (2 given)
  &gt;&gt;&gt; np.imag(32)
  array(0)
  &gt;&gt;&gt; 
  &gt;&gt;&gt; 0+np.imag(1)
  1
  </code></pre>