From 41c9b72c55b9b3efa2da2a7552668c5a15286e5f Mon Sep 17 00:00:00 2001 From: 512song Date: Fri, 15 Sep 2023 14:16:09 +0800 Subject: [PATCH] 20230915 --- 体测单位/体测数据管理.ipynb | 10 ++++- 体测单位/天津石化.ipynb | 88 +++++++++++++++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 5 deletions(-) diff --git a/体测单位/体测数据管理.ipynb b/体测单位/体测数据管理.ipynb index 45129e4..c78a3ab 100644 --- a/体测单位/体测数据管理.ipynb +++ b/体测单位/体测数据管理.ipynb @@ -128,7 +128,15 @@ "id": "63a87059-0a0d-43d3-8b89-0cad64d95ff3", "metadata": {}, "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", diff --git a/体测单位/天津石化.ipynb b/体测单位/天津石化.ipynb index 012352e..dbe7533 100644 --- a/体测单位/天津石化.ipynb +++ b/体测单位/天津石化.ipynb @@ -1,9 +1,22 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "e764be85-0ddf-4055-abd6-de2990e75db8", + "metadata": { + "tags": [], + "toc-hr-collapsed": true + }, + "source": [ + "# 第一次体测" + ] + }, { "cell_type": "markdown", "id": "ae533fe9-e20e-4e44-b9bb-030c4fa4e714", - "metadata": {}, + "metadata": { + "tags": [] + }, "source": [ "## 体测人员导入" ] @@ -1674,13 +1687,80 @@ "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", "execution_count": null, - "id": "683297cb-709a-40e1-a07f-59cf2cf8655b", + "id": "d84c41f5-6e8e-48f6-822f-fb8bdfb278b1", "metadata": {}, "outputs": [], - "source": [] + "source": [ + "## 体测人员导入" + ] } ], "metadata": { @@ -1699,7 +1779,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4,