<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
Let's say I have a 1d numpy array like this
<ASSISTANT_TASK:>
Python Code:
import numpy as np
a = np.array([1.5, -0.4, 1.3])
vals, idx = np.unique(a, return_inverse=True)
b = np.zeros((a.size, vals.size))
b[np.arange(a.size), idx] = 1
<END_TASK>