import numpy as np
def one_hot(CLASS_NUM, i):
b = np.zeros(CLASS_NUM)
b[i] = 1.
return b
print(one_hot(2,0))
print(one_hot(2,1))
print(*one_hot(2,1))#取出list里的元素
print('--------------------------------')
print(one_hot(10,0))
print(one_hot(10,4))
print(one_hot(10,9))