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

change test

parent 90f92be2
...@@ -182,25 +182,28 @@ if __name__ == "__main__": ...@@ -182,25 +182,28 @@ if __name__ == "__main__":
print(len(users_list)) print(len(users_list))
total_samples = list() total_samples = list()
name_tag = get_searchworlds_to_tagid() name_tag = get_searchworlds_to_tagid()
for uid_city in users_list: n = 600
tag_list = get_user_profile(uid_city[0]) users_list = [a[i:i + n] for i in range(0, len(users_list), n)]
queues = get_queues(uid_city[0], uid_city[1]) for child_users_list in users_list:
if len(queues) > 0 and len(tag_list) > 0: for uid_city in child_users_list:
new_native = tag_boost(queues[0], tag_list) tag_list = get_user_profile(uid_city[0])
new_nearby = tag_boost(queues[1], tag_list) queues = get_queues(uid_city[0], uid_city[1])
if len(queues) > 0 and len(tag_list) > 0:
insert_time = str(datetime.datetime.now().strftime('%Y%m%d%H%M')) new_native = tag_boost(queues[0], tag_list)
sample = [uid_city[0], uid_city[1], new_native, new_nearby, queues[2], queues[3], insert_time] new_nearby = tag_boost(queues[1], tag_list)
total_samples.append(sample)
print(len(total_samples)) insert_time = str(datetime.datetime.now().strftime('%Y%m%d%H%M'))
sample = [uid_city[0], uid_city[1], new_native, new_nearby, queues[2], queues[3], insert_time]
if len(total_samples) > 0: total_samples.append(sample)
df = pd.DataFrame(total_samples) print(len(total_samples))
df = df.rename(columns={0: "device_id", 1: "city_id",2:"native_queue",
3:"nearby_queue",4:"nation_queue",5:"megacity_queue",6:"time"}) if len(total_samples) > 0:
df = pd.DataFrame(total_samples)
to_data_base(df) df = df.rename(columns={0: "device_id", 1: "city_id",2:"native_queue",
print("good boy") 3:"nearby_queue",4:"nation_queue",5:"megacity_queue",6:"time"})
to_data_base(df)
print("good boy")
# TODO to kv # TODO to kv
......
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