def index2onehot(index, N):
    L      = index.shape[0]
    onehot = np.zeros((N, L))
    for l in np.arange(L):
        onehot[index[l], l] = 1 
    return onehot
Transforms index to one-hot representation, for example
dataset/ETHPy150Open LxMLS/lxmls-toolkit/lxmls/deep_learning/mlp.py/index2onehot