<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def one_hot(x, size, dtype=np.float32):
 """Make a n+1 dim one-hot array from n dim int-categorical array."""

  return np.array(x[..., np.newaxis] == np.arange(size), dtype)