20230915
This commit is contained in:
1 parent
69f3c0e69f
commit
41c9b72c55
2 files changed
+93
-5
No files matched your search
+9
-1
@@ -128,7 +128,15 @@
|
|||||||
"id": "63a87059-0a0d-43d3-8b89-0cad64d95ff3",
|
"id": "63a87059-0a0d-43d3-8b89-0cad64d95ff3",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": [
|
||||||
|
"import pymongo\n",
|
||||||
|
"\n",
|
||||||
|
"myclient = pymongo.MongoClient('mongodb://localhost:27017/')\n",
|
||||||
|
"mydb = myclient[\"baogao\"]\n",
|
||||||
|
"place_id = 469849\n",
|
||||||
|
"\n",
|
||||||
|
"x = \n"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
|
|||||||
+84
-4
@@ -1,9 +1,22 @@
|
|||||||
{
|
{
|
||||||
"cells": [
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "e764be85-0ddf-4055-abd6-de2990e75db8",
|
||||||
|
"metadata": {
|
||||||
|
"tags": [],
|
||||||
|
"toc-hr-collapsed": true
|
||||||
|
},
|
||||||
|
"source": [
|
||||||
|
"# 第一次体测"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "ae533fe9-e20e-4e44-b9bb-030c4fa4e714",
|
"id": "ae533fe9-e20e-4e44-b9bb-030c4fa4e714",
|
||||||
"metadata": {},
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
"source": [
|
"source": [
|
||||||
"## 体测人员导入"
|
"## 体测人员导入"
|
||||||
]
|
]
|
||||||
@@ -1674,13 +1687,80 @@
|
|||||||
"print('ok!')"
|
"print('ok!')"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "73524e7f-4262-46d3-a733-74ac18e43855",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# 第二次体测"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "1be2bf2c-b1c8-494b-bc6b-681b9e75d18d",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 体测人员导入"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 3,
|
||||||
|
"id": "25283932-c03a-4a34-a59d-314fc64d8fbd",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2023-09-15T06:05:41.102421Z",
|
||||||
|
"iopub.status.busy": "2023-09-15T06:05:41.102217Z",
|
||||||
|
"iopub.status.idle": "2023-09-15T06:05:41.790471Z",
|
||||||
|
"shell.execute_reply": "2023-09-15T06:05:41.789908Z",
|
||||||
|
"shell.execute_reply.started": "2023-09-15T06:05:41.102407Z"
|
||||||
|
},
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"ok\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import openpyxl\n",
|
||||||
|
"import json\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"wb = openpyxl.load_workbook('data/天津石化员工检测花名册(20230915).xlsx')\n",
|
||||||
|
"sheet = wb.active\n",
|
||||||
|
"# sheets = wb.sheetnames\n",
|
||||||
|
"person = {}\n",
|
||||||
|
"\n",
|
||||||
|
"for n in range(2, sheet.max_row+1):\n",
|
||||||
|
" code = int(sheet.cell(n, 1).value)\n",
|
||||||
|
" person.setdefault(code, {})\n",
|
||||||
|
" dict1 = {}\n",
|
||||||
|
" dict1['name'] = sheet.cell(n, 2).value\n",
|
||||||
|
" dict1['sex'] = sheet.cell(n, 3).value\n",
|
||||||
|
" dict1['unit'] = sheet.cell(n, 5).value\n",
|
||||||
|
" dict1['sub_unit'] = sheet.cell(n, 6).value\n",
|
||||||
|
" dict1['birth'] = sheet.cell(n,4).value\n",
|
||||||
|
" person[code] = dict1\n",
|
||||||
|
"filename = 'data/天津石化人员名单2023.json'\n",
|
||||||
|
"with open(filename, 'w') as fl:\n",
|
||||||
|
" json.dump(person, fl, ensure_ascii=False)\n",
|
||||||
|
"print('ok')"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "683297cb-709a-40e1-a07f-59cf2cf8655b",
|
"id": "d84c41f5-6e8e-48f6-822f-fb8bdfb278b1",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": [
|
||||||
|
"## 体测人员导入"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
@@ -1699,7 +1779,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.10.6"
|
"version": "3.10.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
|||||||
Reference in new issue
Block a user