Commit 46b1bed5 authored by 赵威's avatar 赵威

save dict to csv

parent df292642
...@@ -140,7 +140,7 @@ if __name__ == "__main__": ...@@ -140,7 +140,7 @@ if __name__ == "__main__":
for item in get_tractate_info_from_es(["id", "portrait_tag_name"]): for item in get_tractate_info_from_es(["id", "portrait_tag_name"]):
id = item["_id"] id = item["_id"]
tractate_dict[id] = ",".join(item["_source"]["portrait_tag_name"]) tractate_dict[id] = ",".join(item["_source"]["portrait_tag_name"])
save_df_to_csv(tractate_dict, "personas_tractate_tags.csv") save_dict_to_csv(tractate_dict, "personas_tractate_tags.csv")
print(len(tractate_dict)) print(len(tractate_dict))
print(random.choice(list(tractate_dict.items()))) print(random.choice(list(tractate_dict.items())))
......
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