From 591541fa4bb7a2e6de26ed92bc9d6dd1bc9d2518 Mon Sep 17 00:00:00 2001 From: 512song Date: Tue, 7 Nov 2023 23:32:29 +0800 Subject: [PATCH] 20231107 --- 体测单位/天津石化.ipynb | 242 +++++++++++++--------------------------- 1 file changed, 75 insertions(+), 167 deletions(-) diff --git a/体测单位/天津石化.ipynb b/体测单位/天津石化.ipynb index 2ebb6c6..769264d 100644 --- a/体测单位/天津石化.ipynb +++ b/体测单位/天津石化.ipynb @@ -2342,27 +2342,12 @@ }, { "cell_type": "code", - "execution_count": 201, + "execution_count": null, "id": "b363792b-cbc6-46a7-b87f-1e122bcb116e", "metadata": { - "execution": { - "iopub.execute_input": "2023-11-03T11:53:15.355794Z", - "iopub.status.busy": "2023-11-03T11:53:15.355574Z", - "iopub.status.idle": "2023-11-03T11:53:17.167168Z", - "shell.execute_reply": "2023-11-03T11:53:17.166724Z", - "shell.execute_reply.started": "2023-11-03T11:53:15.355779Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "import openpyxl\n", @@ -2417,6 +2402,65 @@ "print('ok') " ] }, + { + "cell_type": "markdown", + "id": "5608369a-f33f-4c02-a68f-f4f7bb410069", + "metadata": {}, + "source": [ + "## 生成新格式文件" + ] + }, + { + "cell_type": "code", + "execution_count": 209, + "id": "8397633f-fddb-4cfa-b9bd-e38f3fe6772c", + "metadata": { + "execution": { + "iopub.execute_input": "2023-11-07T15:21:25.620601Z", + "iopub.status.busy": "2023-11-07T15:21:25.620142Z", + "iopub.status.idle": "2023-11-07T15:21:26.613442Z", + "shell.execute_reply": "2023-11-07T15:21:26.612982Z", + "shell.execute_reply.started": "2023-11-07T15:21:25.620564Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ok\n" + ] + } + ], + "source": [ + "import os,sys,shutil\n", + "import json\n", + "import glob\n", + "from pathlib import Path\n", + "\n", + "fi_path = '/home/songyi/pdf-typescript-old2/134'\n", + "new_path = 'file/134_1'\n", + "old = []\n", + "filename = 'data/result_天津231017.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "\n", + "fls = glob.glob(f'{fi_path}/*.pdf')\n", + "i =0\n", + "for fn in fls:\n", + " code =str(int(Path(fn).stem.split('-')[0]))\n", + " if code in dict1.keys():\n", + " i+=1\n", + " #print(i,code,dict1[code]['rq'].replace('-',''))\n", + " \n", + " n_name = Path(new_path,code.rjust(8,'0')+'_'+dict1[code]['rq'].replace('-','')+'.pdf')\n", + " #print(i,n_name)\n", + " if not os.path.exists(n_name):\n", + " shutil.copyfile(fn,n_name)\n", + "print('ok')" + ] + }, { "cell_type": "markdown", "id": "85a03b00-9624-4ae9-aa6d-386798d457df", @@ -2444,27 +2488,12 @@ }, { "cell_type": "code", - "execution_count": 198, + "execution_count": null, "id": "f9fee64f-41ff-4453-8a32-a33df086022e", "metadata": { - "execution": { - "iopub.execute_input": "2023-11-03T11:30:39.166719Z", - "iopub.status.busy": "2023-11-03T11:30:39.166280Z", - "iopub.status.idle": "2023-11-03T11:30:39.464034Z", - "shell.execute_reply": "2023-11-03T11:30:39.463499Z", - "shell.execute_reply.started": "2023-11-03T11:30:39.166682Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok!\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "import openpyxl\n", @@ -2539,31 +2568,12 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": null, "id": "006afc6c-2b1f-4edf-be1b-5f60e2029ee8", "metadata": { - "execution": { - "iopub.execute_input": "2023-10-25T03:50:53.233122Z", - "iopub.status.busy": "2023-10-25T03:50:53.232833Z", - "iopub.status.idle": "2023-10-25T03:50:53.316856Z", - "shell.execute_reply": "2023-10-25T03:50:53.316327Z", - "shell.execute_reply.started": "2023-10-25T03:50:53.233097Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0~255分人数:2524人,男性:2056人,女性:468人\n", - "256~332分人数:2214人,男性:1400人,女性:814人\n", - "333~367分人数:495人,男性:274人,女性:221人\n", - "368~500分人数:150人,男性:58人,女性:92人\n", - "5383\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n", @@ -2606,34 +2616,12 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": null, "id": "949e4c3c-023d-44a4-b99e-c5460da61161", "metadata": { - "execution": { - "iopub.execute_input": "2023-10-25T03:50:55.994714Z", - "iopub.status.busy": "2023-10-25T03:50:55.994442Z", - "iopub.status.idle": "2023-10-25T03:50:56.087067Z", - "shell.execute_reply": "2023-10-25T03:50:56.086443Z", - "shell.execute_reply.started": "2023-10-25T03:50:55.994689Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "20~24岁平均成绩:2.47分,人数:1044人,男性:706人\n", - "25~29岁平均成绩:2.57分,人数:540人,男性:372人\n", - "30~34岁平均成绩:2.59分,人数:240人,男性:165人\n", - "35~39岁平均成绩:2.63分,人数:475人,男性:328人\n", - "40~44岁平均成绩:2.68分,人数:411人,男性:245人\n", - "45~49岁平均成绩:2.67分,人数:883人,男性:466人\n", - "50~54岁平均成绩:2.57分,人数:1213人,男性:929人\n", - "55~69岁平均成绩:2.48分,人数:577人,男性:577人\n" - ] - } - ], + "outputs": [], "source": [ "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,69]]\n", "\n", @@ -2666,34 +2654,12 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": null, "id": "721977d3-5816-4bf6-82fc-26fd170e5454", "metadata": { - "execution": { - "iopub.execute_input": "2023-10-25T03:51:22.393382Z", - "iopub.status.busy": "2023-10-25T03:51:22.393098Z", - "iopub.status.idle": "2023-10-25T03:51:22.503597Z", - "shell.execute_reply": "2023-10-25T03:51:22.502884Z", - "shell.execute_reply.started": "2023-10-25T03:51:22.393358Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "20~24岁平均成绩:2.38分,人数:706人\n", - "25~29岁平均成绩:2.5分,人数:372人\n", - "30~34岁平均成绩:2.46分,人数:165人\n", - "35~39岁平均成绩:2.49分,人数:328人\n", - "40~44岁平均成绩:2.56分,人数:245人\n", - "45~49岁平均成绩:2.47分,人数:466人\n", - "50~54岁平均成绩:2.47分,人数:929人\n", - "55~80岁平均成绩:2.48分,人数:577人\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n", @@ -2727,34 +2693,12 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": null, "id": "f493dc0a-d3cd-4dbd-ad35-e06eb96afbc5", "metadata": { - "execution": { - "iopub.execute_input": "2023-10-25T03:51:25.001730Z", - "iopub.status.busy": "2023-10-25T03:51:25.001459Z", - "iopub.status.idle": "2023-10-25T03:51:25.099310Z", - "shell.execute_reply": "2023-10-25T03:51:25.098566Z", - "shell.execute_reply.started": "2023-10-25T03:51:25.001706Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "20~24岁平均成绩:2.65分,人数:338人\n", - "25~29岁平均成绩:2.72分,人数:168人\n", - "30~34岁平均成绩:2.84分,人数:75人\n", - "35~39岁平均成绩:2.93分,人数:147人\n", - "40~44岁平均成绩:2.83分,人数:166人\n", - "45~49岁平均成绩:2.89分,人数:417人\n", - "50~54岁平均成绩:2.88分,人数:284人\n", - "55~80岁平均成绩:0.0分,人数:0人\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n", @@ -2788,29 +2732,12 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": null, "id": "7155f2c2-0719-4558-aa3b-629fb70194d6", "metadata": { - "execution": { - "iopub.execute_input": "2023-10-25T03:51:48.682998Z", - "iopub.status.busy": "2023-10-25T03:51:48.682686Z", - "iopub.status.idle": "2023-10-25T03:51:48.834661Z", - "shell.execute_reply": "2023-10-25T03:51:48.834139Z", - "shell.execute_reply.started": "2023-10-25T03:51:48.682964Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "平均成绩:2.4704分,男性:3788人\n", - "平均成绩:2.8269分,女性:1595人\n", - "平均成绩:2.576分,总体:5383人\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n", @@ -2849,31 +2776,12 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": null, "id": "a0bbb339-ee4e-4dc1-83ec-b2055e3c670e", "metadata": { - "execution": { - "iopub.execute_input": "2023-10-25T03:52:43.358905Z", - "iopub.status.busy": "2023-10-25T03:52:43.358608Z", - "iopub.status.idle": "2023-10-25T03:52:43.644315Z", - "shell.execute_reply": "2023-10-25T03:52:43.643658Z", - "shell.execute_reply.started": "2023-10-25T03:52:43.358879Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0~255分人数:2524人,男性:2056人,女性:468人\n", - "256~332分人数:2214人,男性:1400人,女性:814人\n", - "333~367分人数:495人,男性:274人,女性:221人\n", - "368~500分人数:150人,男性:58人,女性:92人\n", - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n",