Commit df53b81f authored by 张彦钊's avatar 张彦钊

add

parent f91f879b
......@@ -153,8 +153,8 @@ def hospital():
result = cursor.fetchall()
db.close()
tmp = pd.DataFrame(list(result))
name = ["merchant_id", "doctor_ad_money_30_days", "expand_rechange_amount_30", "service_pv_30",
"mexpert_pv_30", "organization_pv_30","doctor_discount_30_days"]
name = ["merchant_id", "doctor_ad_money_30_days","service_pv_30","mexpert_pv_30","organization_pv_30",
"doctor_discount_30_days"]
tmp = tmp.rename(columns=dict(zip(list(range(len(name))), name)))
print(tmp.head(6))
......@@ -163,9 +163,9 @@ def hospital():
df = pd.merge(df, tmp, on='merchant_id')
for i in ["hospital_exposure_pv_30","service_exposure_pv_30","expert_exposure_pv_30",
"service_ctr_30","hospital_ctr_30","expert_ctr_30",
"doctor_ad_money_30_days", "service_pv_30",
"mexpert_pv_30", "organization_pv_30", "budan_payment_30_days","doctor_discount_30_days"]:
"service_ctr_30","hospital_ctr_30","expert_ctr_30","budan_payment_30_days",
"doctor_ad_money_30_days","service_pv_30","mexpert_pv_30","organization_pv_30",
"doctor_discount_30_days"]:
df[i] = df[i].astype("float")
df["all_exposure"] = df["hospital_exposure_pv_30"] + df["service_exposure_pv_30"] + df["expert_exposure_pv_30"]
......
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