20230915
This commit is contained in:
1 parent
83e5aa4218
commit
0f116c7e94
4 files changed
+83
-26
No files matched your search
@@ -1,5 +1,54 @@
|
|||||||
{
|
{
|
||||||
"cells": [
|
"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",
|
"cell_type": "markdown",
|
||||||
"id": "dcfbd41f-ca70-4f15-9153-60e6aaac27e8",
|
"id": "dcfbd41f-ca70-4f15-9153-60e6aaac27e8",
|
||||||
|
|||||||
+27
-2
@@ -827,13 +827,38 @@
|
|||||||
" "
|
" "
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "39cd284f-99fe-4ba0-928c-9da01042e394",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 合并人员信息"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "8c89b12a-0ab5-4792-94b6-456e352a00ce",
|
"id": "7ef51041-ad78-4c6a-af83-ed3e0473b199",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"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": {
|
"metadata": {
|
||||||
|
|||||||
+5
-22
@@ -863,20 +863,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 3,
|
"execution_count": null,
|
||||||
"id": "c828b665-d178-42e4-a885-505045169102",
|
"id": "c828b665-d178-42e4-a885-505045169102",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"ok\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"import json\n",
|
"import json\n",
|
||||||
@@ -918,21 +910,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 4,
|
"execution_count": null,
|
||||||
"id": "3f1b2284-c39e-4dc2-bc0c-983fb8e3417f",
|
"id": "3f1b2284-c39e-4dc2-bc0c-983fb8e3417f",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"508\n",
|
|
||||||
"508\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"import time\n",
|
"import time\n",
|
||||||
@@ -990,7 +973,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 6,
|
"execution_count": null,
|
||||||
"id": "9d5d379c-5b53-4716-b4ab-fa794c912853",
|
"id": "9d5d379c-5b53-4716-b4ab-fa794c912853",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"tags": []
|
"tags": []
|
||||||
|
|||||||
+2
-2
@@ -212,7 +212,7 @@
|
|||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Python 3",
|
"display_name": "Python 3 (ipykernel)",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
},
|
},
|
||||||
@@ -226,7 +226,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.8.10"
|
"version": "3.10.12"
|
||||||
},
|
},
|
||||||
"toc-autonumbering": false
|
"toc-autonumbering": false
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user