20241224
This commit is contained in:
1 parent
82372feb99
commit
c801f150ae
6 files changed
+1787
-626
No files matched your search
+144
-117
@@ -4,6 +4,7 @@
|
||||
"cell_type": "markdown",
|
||||
"id": "1c72f0cf-165b-4025-af9d-6771e4a0a5d1",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true,
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
@@ -2181,26 +2182,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"execution_count": null,
|
||||
"id": "e1a1b329-acf1-4be9-bcf0-736dbe7f8e0b",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T06:33:02.890686Z",
|
||||
"iopub.status.busy": "2024-12-06T06:33:02.889945Z",
|
||||
"iopub.status.idle": "2024-12-06T06:33:02.953794Z",
|
||||
"shell.execute_reply": "2024-12-06T06:33:02.953311Z",
|
||||
"shell.execute_reply.started": "2024-12-06T06:33:02.890614Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"739\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import datetime\n",
|
||||
@@ -2265,17 +2250,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 36,
|
||||
"execution_count": null,
|
||||
"id": "17ebb0fd-9a45-47a4-bbe9-f4fb0a3481f6",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T06:33:08.201679Z",
|
||||
"iopub.status.busy": "2024-12-06T06:33:08.200968Z",
|
||||
"iopub.status.idle": "2024-12-06T06:33:08.367295Z",
|
||||
"shell.execute_reply": "2024-12-06T06:33:08.366715Z",
|
||||
"shell.execute_reply.started": "2024-12-06T06:33:08.201614Z"
|
||||
}
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -2336,26 +2313,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 37,
|
||||
"execution_count": null,
|
||||
"id": "dd89efe8-13b9-4db8-8c39-2a48888dd635",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T06:34:03.871370Z",
|
||||
"iopub.status.busy": "2024-12-06T06:34:03.870707Z",
|
||||
"iopub.status.idle": "2024-12-06T06:34:05.280791Z",
|
||||
"shell.execute_reply": "2024-12-06T06:34:05.280240Z",
|
||||
"shell.execute_reply.started": "2024-12-06T06:34:03.871312Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok!\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
@@ -2392,6 +2353,130 @@
|
||||
"print('ok!') "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5b9aef88-0341-4af0-8316-c7e2266f4b0c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计参加问卷手机号码未提供人员"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "25004a96-c72c-4bbb-91e1-5bfccb7856c3",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"filename = 'data/北海炼化人员2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"phone1 = set()\n",
|
||||
"phone2 = set()\n",
|
||||
"for k,v in dict1.items():\n",
|
||||
" phone1.add(v['phone'])\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20241224.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
" for line in fl:\n",
|
||||
" list1.append(line)\n",
|
||||
"\n",
|
||||
"for item in list1:\n",
|
||||
" if item[2] not in phone1:\n",
|
||||
" phone2.add(item[2])\n",
|
||||
"for item in phone2:\n",
|
||||
" print(i,item)\n",
|
||||
" i+=1\n",
|
||||
" "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "cca613c5-1fe3-465a-ab66-ca395e4bda9c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计参加问卷人员"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"id": "601f707b-bd34-4966-b781-c520a0bf69dc",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-24T07:03:16.793791Z",
|
||||
"iopub.status.busy": "2024-12-24T07:03:16.793020Z",
|
||||
"iopub.status.idle": "2024-12-24T07:03:16.938934Z",
|
||||
"shell.execute_reply": "2024-12-24T07:03:16.938312Z",
|
||||
"shell.execute_reply.started": "2024-12-24T07:03:16.793721Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"876\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"filename = 'data/北海炼化人员2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"phone1 = set()\n",
|
||||
"phone2 = set()\n",
|
||||
"for k,v in dict1.items():\n",
|
||||
" phone1.add(v['phone'])\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20241224.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
" for line in fl:\n",
|
||||
" list1.append(line)\n",
|
||||
"print(len(phone1))\n",
|
||||
"i =1\n",
|
||||
"list2 = []\n",
|
||||
"for item in list1:\n",
|
||||
" code = item[2]\n",
|
||||
" for k, v in dict1.items():\n",
|
||||
" list3 = []\n",
|
||||
" if v['phone'] == code: \n",
|
||||
" list3.append(k)\n",
|
||||
" list3.append(v['name'])\n",
|
||||
" list3.append(v['sex'])\n",
|
||||
" list3.append(v['unit'])\n",
|
||||
" list3.append(code)\n",
|
||||
" list2.append(list3)\n",
|
||||
"filename = 'data/北海炼化问卷情况表2024.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
"for row in list2:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b57447d9-ac3c-47c2-9592-3878c6845918",
|
||||
@@ -2402,17 +2487,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 43,
|
||||
"execution_count": null,
|
||||
"id": "9563c47b-94e4-44f7-98e1-7d284ad3841c",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T13:25:18.037788Z",
|
||||
"iopub.status.busy": "2024-12-06T13:25:18.037123Z",
|
||||
"iopub.status.idle": "2024-12-06T13:25:18.169186Z",
|
||||
"shell.execute_reply": "2024-12-06T13:25:18.168612Z",
|
||||
"shell.execute_reply.started": "2024-12-06T13:25:18.037728Z"
|
||||
}
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -2515,26 +2592,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 47,
|
||||
"execution_count": null,
|
||||
"id": "a1a12409-aab8-47af-b10d-7ecb20b3b332",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T13:41:57.576034Z",
|
||||
"iopub.status.busy": "2024-12-06T13:41:57.575284Z",
|
||||
"iopub.status.idle": "2024-12-06T13:41:57.808661Z",
|
||||
"shell.execute_reply": "2024-12-06T13:41:57.808089Z",
|
||||
"shell.execute_reply.started": "2024-12-06T13:41:57.575964Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
@@ -2701,27 +2762,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 39,
|
||||
"execution_count": null,
|
||||
"id": "6d8a345d-39e0-40cd-9bed-ac4e144b426c",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T07:47:19.162940Z",
|
||||
"iopub.status.busy": "2024-12-06T07:47:19.162185Z",
|
||||
"iopub.status.idle": "2024-12-06T07:47:19.214132Z",
|
||||
"shell.execute_reply": "2024-12-06T07:47:19.213530Z",
|
||||
"shell.execute_reply.started": "2024-12-06T07:47:19.162868Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"738\n",
|
||||
"ok!\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
@@ -2789,27 +2833,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 58,
|
||||
"execution_count": null,
|
||||
"id": "6cba8d5e-92fd-4afd-94d2-0dcf42e2e22e",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T14:55:55.316383Z",
|
||||
"iopub.status.busy": "2024-12-06T14:55:55.315888Z",
|
||||
"iopub.status.idle": "2024-12-06T14:55:55.397708Z",
|
||||
"shell.execute_reply": "2024-12-06T14:55:55.397100Z",
|
||||
"shell.execute_reply.started": "2024-12-06T14:55:55.316334Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"757\n",
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
|
||||
Reference in new issue
Block a user