One Hot Encoding using numpy
<p>If the input is zero I want to make an array which looks like this:</p>

<pre><code>[1,0,0,0,0,0,0,0,0,0]
</code></pre>

<p>and if the input is 5:</p>

<pre><code>[0,0,0,0,0,1,0,0,0,0]
</code></pre>

<p>For the above I wrote:</p>

<pre><code>np.put(np.zeros(10),5,1)
</code></pre>

<p>but it did not work.</p>

<p>Is there any way in which, this can be implemented in one line?</p>