conver them do DataFrame df
which could be also converted as classified one hot array y
:
import numpy as np
import pandas as pd
a={'name1': np.array([0., 0., 1., 0., 0.]), 'name2': np.array([0., 1., 0., 0., 0.])}
df=pd.DataFrame(a)
y=np.array(df)
df
content is:
name1 name2
0 0.0 0.0
1 0.0 1.0
2 1.0 0.0
3 0.0 0.0
4 0.0 0.0
y
content is:
array([[0., 0.],
[0., 1.],
[1., 0.],
[0., 0.],
[0., 0.]])
so, you can use either of them
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…