list转dataframe
用于制作label
python
label_list = []
for label in df_label_data.values:
if label == 0:
label_list.append([0, 0]) #
elif label == 1:
label_list.append([1, 0]) # 曝光点击了ctr,未点击购买
elif label == 2:
label_list.append([1, 1]) # 曝光点击了,且点击购买了
print(df_label_data.values)
[0 0 0 ... 0 0 0]
python
df_label = pd.DataFrame(np.array(label_list), columns=['click', 'conversion'])
print(df_label.shape)
(17717195, 2)