From b7dabe4171ba2189ade5d6158fdb905269d6639b Mon Sep 17 00:00:00 2001 From: 512song Date: Wed, 20 Sep 2023 20:10:12 +0800 Subject: [PATCH] 20230920 --- 体测单位/天津石化.ipynb | 78 ++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/体测单位/天津石化.ipynb b/体测单位/天津石化.ipynb index 4e222dc..f2e8377 100644 --- a/体测单位/天津石化.ipynb +++ b/体测单位/天津石化.ipynb @@ -1505,15 +1505,15 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 40, "id": "25283932-c03a-4a34-a59d-314fc64d8fbd", "metadata": { "execution": { - "iopub.execute_input": "2023-09-19T09:55:56.717650Z", - "iopub.status.busy": "2023-09-19T09:55:56.717215Z", - "iopub.status.idle": "2023-09-19T09:55:57.413548Z", - "shell.execute_reply": "2023-09-19T09:55:57.413082Z", - "shell.execute_reply.started": "2023-09-19T09:55:56.717617Z" + "iopub.execute_input": "2023-09-20T10:10:02.758922Z", + "iopub.status.busy": "2023-09-20T10:10:02.758473Z", + "iopub.status.idle": "2023-09-20T10:10:03.499992Z", + "shell.execute_reply": "2023-09-20T10:10:03.499518Z", + "shell.execute_reply.started": "2023-09-20T10:10:02.758886Z" }, "tags": [] }, @@ -1600,15 +1600,15 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 42, "id": "e26b88fc-c75b-4c1e-82ea-5017370afa9b", "metadata": { "execution": { - "iopub.execute_input": "2023-09-19T09:56:00.774430Z", - "iopub.status.busy": "2023-09-19T09:56:00.774175Z", - "iopub.status.idle": "2023-09-19T09:56:00.815234Z", - "shell.execute_reply": "2023-09-19T09:56:00.814836Z", - "shell.execute_reply.started": "2023-09-19T09:56:00.774414Z" + "iopub.execute_input": "2023-09-20T10:12:15.164390Z", + "iopub.status.busy": "2023-09-20T10:12:15.163888Z", + "iopub.status.idle": "2023-09-20T10:12:15.331894Z", + "shell.execute_reply": "2023-09-20T10:12:15.331424Z", + "shell.execute_reply.started": "2023-09-20T10:12:15.164354Z" }, "tags": [] }, @@ -1617,8 +1617,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "548\n", - "548\n" + "891\n", + "891\n" ] } ], @@ -1641,7 +1641,7 @@ "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", "\n", - "filename = 'data/places_result_20230919.csv'\n", + "filename = 'data/places_result_20230920.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -1680,15 +1680,15 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 43, "id": "0a6ea33d-c112-4ed8-9366-3376e55a5731", "metadata": { "execution": { - "iopub.execute_input": "2023-09-19T09:56:14.365981Z", - "iopub.status.busy": "2023-09-19T09:56:14.365507Z", - "iopub.status.idle": "2023-09-19T09:56:14.524260Z", - "shell.execute_reply": "2023-09-19T09:56:14.523770Z", - "shell.execute_reply.started": "2023-09-19T09:56:14.365945Z" + "iopub.execute_input": "2023-09-20T10:15:10.009585Z", + "iopub.status.busy": "2023-09-20T10:15:10.009190Z", + "iopub.status.idle": "2023-09-20T10:15:10.258788Z", + "shell.execute_reply": "2023-09-20T10:15:10.258306Z", + "shell.execute_reply.started": "2023-09-20T10:15:10.009553Z" }, "tags": [] }, @@ -1724,7 +1724,7 @@ " else:\n", " list2.append('') \n", " list1.append(list2)\n", - "filename = 'data/天津石化体测情况(截至20230919).xlsx'\n", + "filename = 'data/天津石化体测情况(截至20230920).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "sheet.append(title)\n", @@ -1744,15 +1744,15 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 47, "id": "589a5d44-605d-41a1-a981-7ec7258305ed", "metadata": { "execution": { - "iopub.execute_input": "2023-09-19T10:14:32.330635Z", - "iopub.status.busy": "2023-09-19T10:14:32.330164Z", - "iopub.status.idle": "2023-09-19T10:14:32.413959Z", - "shell.execute_reply": "2023-09-19T10:14:32.412831Z", - "shell.execute_reply.started": "2023-09-19T10:14:32.330599Z" + "iopub.execute_input": "2023-09-20T10:20:29.348632Z", + "iopub.status.busy": "2023-09-20T10:20:29.348164Z", + "iopub.status.idle": "2023-09-20T10:20:29.412315Z", + "shell.execute_reply": "2023-09-20T10:20:29.411103Z", + "shell.execute_reply.started": "2023-09-20T10:20:29.348596Z" }, "tags": [] }, @@ -1771,25 +1771,25 @@ "dict3 = {}\n", "for k, v in dict2.items():\n", " unit = v['unit']\n", - " sub_unit = v['sub_unit']\n", + " #sub_unit = v['sub_unit']\n", " dict3.setdefault(unit,{})\n", - " #dict3[unit].setdefault('人数',0)\n", - " dict3[unit].setdefault(sub_unit,0)\n", - " dict3[unit][sub_unit] = dict3[unit][sub_unit] + 1\n", - " #dict3[unit]['人数'] = dict3[unit]['人数'] + 1\n", + " dict3[unit].setdefault('人数',0)\n", + " #dict3[unit].setdefault(sub_unit,0)\n", + " #dict3[unit][sub_unit] = dict3[unit][sub_unit] + 1\n", + " dict3[unit]['人数'] = dict3[unit]['人数'] + 1\n", "\n", "title =['单位','体测人数']\n", "list1 = []\n", "for k,v in dict1.items(): \n", " unit = v['unit']\n", - " sub_unit = v['sub_unit']\n", - " dict3[unit][sub_unit] = dict3[unit][sub_unit] - 1\n", + " #sub_unit = v['sub_unit']\n", + " #dict3[unit][sub_unit] = dict3[unit][sub_unit] - 1\n", + " dict3[unit]['人数'] = dict3[unit]['人数'] - 1\n", "for k, v in dict3.items():\n", - " for k1, v1 in v.items():\n", - " list2 = [k,k1,v1]\n", - " list1.append(list2)\n", + " list2 = [k,v['人数']]\n", + " list1.append(list2)\n", "\n", - "filename = 'data/天津部门未测试情况(截至20230919).xlsx'\n", + "filename = 'data/天津部门未测试情况(截至20230920).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "sheet.append(title)\n",