Commit 646832fd authored by 高雅喆's avatar 高雅喆

change timestamp output

parent 0586fd72
......@@ -30,9 +30,7 @@ def main():
df1 = pd.read_csv("/home/gaoyazhe/data/native/pred.txt",sep='\t',header=None,names=["ctr","cvr","ctcvr"])
df2["ctr"],df2["cvr"],df2["ctcvr"] = df1["ctr"],df1["cvr"],df1["ctcvr"]
df3 = df2.groupby(by=["uid","city"]).apply(lambda x: x.sort_values(by="ctcvr",ascending=False)).reset_index(drop=True).groupby(by=["uid","city"]).agg({'cid_id':set_join}).reset_index(drop=False)
ctime = int(time.time())
df3["time"] = ctime
df3.columns = ["device_id","city_id","native_queue","time"]
df3.columns = ["device_id","city_id","native_queue"]
print("native_device_count",df3.shape)
......@@ -48,6 +46,8 @@ def main():
#union
df_all = pd.merge(df3,df4,on=['device_id','city_id'],how='outer').fillna("")
ctime = int(time.time())
df_all["time"] = ctime
print("union_device_count",df_all.shape)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment