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

add filter cid

parent 2803e735
......@@ -21,15 +21,25 @@ def test_con_sql(device_id):
result = cursor.fetchall()
df = pd.DataFrame(list(result))
if not df.empty:
data_set_cid = pd.read_csv(DIRECTORY_PATH + "data_set_cid.csv")["cid"].values.tolist()
df = df.rename(columns={0: "native_queue", 1: "nearby_queue", 2: "nation_queue", 3: "megacity_queue"})
native_queue = df.loc[0, "native_queue"].split(",")
native_queue = list(map(lambda x:"diary|"+str(x),native_queue))
native_queue = list(set(native_queue)&set(data_set_cid))
nearby_queue = df.loc[0, "nearby_queue"].split(",")
nearby_queue = list(map(lambda x: "diary|" + str(x), nearby_queue))
nearby_queue = list(set(nearby_queue)&set(data_set_cid))
nation_queue = df.loc[0, "nation_queue"].split(",")
nation_queue = list(map(lambda x: "diary|" + str(x), nation_queue))
nation_queue = list(set(nation_queue)&set(data_set_cid))
megacity_queue = df.loc[0, "megacity_queue"].split(",")
megacity_queue = list(map(lambda x: "diary|" + str(x), megacity_queue))
megacity_queue = list(set(megacity_queue)&set(data_set_cid))
db.close()
print("成功获取日记队列")
......
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