diff --git a/make_data.py b/make_data.py index 0c39870a6cc2839486d26977a412bfc987eea67e..64c7f53c6ced4ecacaa62673abf22ab304d1e82a 100644 --- a/make_data.py +++ b/make_data.py @@ -3,6 +3,36 @@ import pymysql import pandas as pd +def exp(): + date_str = "20200101" + + sql = "select b.merchant_id " \ + "from statistic_doctor_rank_factor d " \ + "left join hippo_merchantrelevance b on d.doctor_id = b.doctor_id " \ + "where d.partition_date = '{}';".format(date_str) + + db = pymysql.connect(host='172.16.30.143', port=3306, user='work', passwd='BJQaT9VzDcuPBqkd', db='zhengxing') + cursor = db.cursor() + cursor.execute(sql) + result = cursor.fetchall() + h_merchant_id = pd.DataFrame(list(result))[0].values.tolist() + print(len(h_merchant_id)) + print(h_merchant_id[:6]) + + sql = "select merchant_id from statistic_merchant_rank_factor " \ + "where partition_date = '{}';".format(date_str) + + cursor = db.cursor() + cursor.execute(sql) + result = cursor.fetchall() + db.close() + s_merchant_id = pd.DataFrame(list(result))[0].values.tolist() + print(len(s_merchant_id)) + print(s_merchant_id[:6]) + + print(len(set(s_merchant_id)&set(h_merchant_id))) + + def doctor(): date_str = "20200101" date_tmp = "2020-01-01" @@ -183,6 +213,8 @@ def hospital(): if __name__ == "__main__": - doctor() - hospital() + # doctor() + # hospital() + + exp()