From 0f116c7e94f919719ded2843c69de8d386b0ef96 Mon Sep 17 00:00:00 2001 From: 512song Date: Fri, 15 Sep 2023 12:09:56 +0800 Subject: [PATCH] 20230915 --- 体测单位/体测数据管理.ipynb | 49 +++++++++++++++++++++++++++++++++++++ 体测单位/北京农行.ipynb | 29 ++++++++++++++++++++-- 体测单位/长炼医院.ipynb | 27 ++++---------------- 高校资料管理.ipynb | 4 +-- 4 files changed, 83 insertions(+), 26 deletions(-) diff --git a/体测单位/体测数据管理.ipynb b/体测单位/体测数据管理.ipynb index d9ec4d0..1b0a1f8 100644 --- a/体测单位/体测数据管理.ipynb +++ b/体测单位/体测数据管理.ipynb @@ -1,5 +1,54 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "e6dcc663-e0ed-4ea3-b442-11f229f4af94", + "metadata": {}, + "source": [ + "## 新增体测单位" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "360f0a97-d73d-43f3-9f7a-0f9582103c82", + "metadata": { + "execution": { + "iopub.execute_input": "2023-09-15T03:53:47.937290Z", + "iopub.status.busy": "2023-09-15T03:53:47.936825Z", + "iopub.status.idle": "2023-09-15T03:53:47.950180Z", + "shell.execute_reply": "2023-09-15T03:53:47.949521Z", + "shell.execute_reply.started": "2023-09-15T03:53:47.937254Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n" + ] + } + ], + "source": [ + "import pymongo\n", + "\n", + "myclient = pymongo.MongoClient('mongodb://localhost:27017/')\n", + "mydb = myclient[\"baogao\"]\n", + "mycol = mydb[\"place\"]\n", + "\n", + "id = 469849\n", + "name = \"长炼医院\"\n", + "myquery = { \"id\": id }\n", + "num = mycol.count_documents(myquery)\n", + "if num>0:\n", + " print(num)\n", + "else:\n", + " mydict = { \"id\":id,\"name\": name, }\n", + " x = mycol.insert_one(mydict) " + ] + }, { "cell_type": "markdown", "id": "dcfbd41f-ca70-4f15-9153-60e6aaac27e8", diff --git a/体测单位/北京农行.ipynb b/体测单位/北京农行.ipynb index 5cead35..1c4efe8 100644 --- a/体测单位/北京农行.ipynb +++ b/体测单位/北京农行.ipynb @@ -827,13 +827,38 @@ " " ] }, + { + "cell_type": "markdown", + "id": "39cd284f-99fe-4ba0-928c-9da01042e394", + "metadata": {}, + "source": [ + "## 合并人员信息" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "8c89b12a-0ab5-4792-94b6-456e352a00ce", + "id": "7ef51041-ad78-4c6a-af83-ed3e0473b199", "metadata": {}, "outputs": [], - "source": [] + "source": [ + "import json\n", + "\n", + "filename = 'data/北京农行人员名单2308.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "\n", + "filename = 'data/北京农行人员名单.json'\n", + "with open(filename,'r') as fl:\n", + " dict2 = json.load(fl) \n", + "for k, v in dict2.items():\n", + " dict1[k] = v\n", + "filename = 'data/北京农行人员名单all.json'\n", + "\n", + "with open(filename,'w') as fl:\n", + " json.dump(dict1, fl, ensure_ascii=False) \n", + "print(len(re_ta))" + ] } ], "metadata": { diff --git a/体测单位/长炼医院.ipynb b/体测单位/长炼医院.ipynb index 8d2d222..1667b1e 100644 --- a/体测单位/长炼医院.ipynb +++ b/体测单位/长炼医院.ipynb @@ -863,20 +863,12 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "c828b665-d178-42e4-a885-505045169102", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import openpyxl\n", "import json\n", @@ -918,21 +910,12 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "3f1b2284-c39e-4dc2-bc0c-983fb8e3417f", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "508\n", - "508\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "import time\n", @@ -990,7 +973,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "9d5d379c-5b53-4716-b4ab-fa794c912853", "metadata": { "tags": [] diff --git a/高校资料管理.ipynb b/高校资料管理.ipynb index 2aa63ee..3c44086 100644 --- a/高校资料管理.ipynb +++ b/高校资料管理.ipynb @@ -212,7 +212,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -226,7 +226,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.10.12" }, "toc-autonumbering": false },