Files
jupyter/体测单位/石家庄石化.ipynb
T
2023-05-16 23:06:49 +08:00

1428 lines
52 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"cells": [
{
"cell_type": "markdown",
"id": "021f4ec4-47cd-433a-9d0a-91176b398f32",
"metadata": {},
"source": [
"## 导入人员信息"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "9bd78072-29e5-4c98-8bbe-97f525cf9e4a",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T00:37:19.185801Z",
"iopub.status.busy": "2023-05-16T00:37:19.185377Z",
"iopub.status.idle": "2023-05-16T00:37:20.015287Z",
"shell.execute_reply": "2023-05-16T00:37:20.014538Z",
"shell.execute_reply.started": "2023-05-16T00:37:19.185772Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"import openpyxl\n",
"import json\n",
"\n",
"\n",
"wb = openpyxl.load_workbook('data/student_20140922(石家庄监测花名册2023年).xlsx')\n",
"sheet = wb.active\n",
"# sheets = wb.sheetnames\n",
"person = {}\n",
"\n",
"for n in range(2, sheet.max_row+1):\n",
" if sheet.cell(n,1).value is not None:\n",
" code = int(sheet.cell(n, 4).value)\n",
" person.setdefault(code, {})\n",
" dict1 = {}\n",
" dict1['name'] = sheet.cell(n, 6).value\n",
" if sheet.cell(n, 7).value ==1:\n",
" sex = '男'\n",
" else:\n",
" sex = '女'\n",
" dict1['sex'] = sex\n",
" dict1['unit'] = sheet.cell(n, 3).value\n",
" dict1['birth'] = sheet.cell(n, 8).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,default=str)\n",
"print('ok')"
]
},
{
"cell_type": "markdown",
"id": "cb4e0b2a-a17a-470c-afcd-2a532c00f6d0",
"metadata": {},
"source": [
"## 每日成绩导入"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "dd3c65ea-cc8a-4f1b-8698-d1799f99e101",
"metadata": {
"execution": {
"iopub.execute_input": "2023-04-27T07:07:34.179338Z",
"iopub.status.busy": "2023-04-27T07:07:34.178517Z",
"iopub.status.idle": "2023-04-27T07:07:34.222956Z",
"shell.execute_reply": "2023-04-27T07:07:34.221926Z",
"shell.execute_reply.started": "2023-04-27T07:07:34.179297Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"118\n",
"ok\n"
]
}
],
"source": [
"import json\n",
"import time\n",
"import csv\n",
"\n",
"filename = '../item.json'\n",
"item = {}\n",
"unit = {}\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for k,v in dict1.items():\n",
" item[k] = v\n",
"re_ta = {}\n",
"dict1 = {}\n",
"list1 = []\n",
"filename = 'data/石家庄2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20230427-sjz.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",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" list1.append(line)\n",
"#print(list1)\n",
"for result in list1:\n",
" user = str(result[2])\n",
" if user in dict1.keys():\n",
" \n",
" m_item = str(result[3]) \n",
" re_ta.setdefault(user,{}) \n",
" re_ta[user]['name'] = dict1[user]['name']\n",
" re_ta[user]['sex'] = dict1[user]['sex'] \n",
" re_ta[user]['部门'] = dict1[user]['unit']\n",
" item_name = item[m_item]['name']\n",
" re_ta[user].setdefault(item_name,{}) \n",
" score = int(result[4])/item[m_item]['divisor'] \n",
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
"print(len(re_ta))\n",
"filename = 'data/result_石家庄(20230427).json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl) \n",
"print('ok')"
]
},
{
"cell_type": "markdown",
"id": "a2127ef7-230f-434e-a817-3d4948ed0ca4",
"metadata": {},
"source": [
"## 每日成绩导出"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "97d86ce2-6664-41a1-89d2-ddaa0611bac1",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-05T13:31:23.049611Z",
"iopub.status.busy": "2023-05-05T13:31:23.048757Z",
"iopub.status.idle": "2023-05-05T13:31:23.590103Z",
"shell.execute_reply": "2023-05-05T13:31:23.589419Z",
"shell.execute_reply.started": "2023-05-05T13:31:23.049566Z"
},
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
"title = ['编号','姓名','性别','单位','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"filename = 'data/石家庄2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl)\n",
" \n",
"list1 = []\n",
"for k, v in dict1.items():\n",
" list2 = []\n",
" list2.append(str(k).rjust(5,'0'))\n",
" list2.append(v['name']) \n",
" list2.append(dict2[k]['sex'])\n",
" list2.append(dict2[k]['unit']) \n",
" \n",
" for item in items:\n",
" if item in v.keys():\n",
" list2.append(v[item]['成绩']) \n",
" elif item =='name':\n",
" list2.append(v[item])\n",
" else:\n",
" list2.append('') \n",
" list1.append(list2)\n",
"filename = 'data/石家庄石化体测情况表.xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
"for row in list1:\n",
" sheet.append(row)\n",
" \n",
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "6fae0c4a-f0f6-4abe-bd3a-ea9fef87f2c6",
"metadata": {},
"source": [
"## 总成绩导入"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "e2b68cb1-3a6f-4b51-afbd-d6c9634348b1",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-05T13:30:29.397704Z",
"iopub.status.busy": "2023-05-05T13:30:29.396865Z",
"iopub.status.idle": "2023-05-05T13:30:29.654357Z",
"shell.execute_reply": "2023-05-05T13:30:29.653607Z",
"shell.execute_reply.started": "2023-05-05T13:30:29.397657Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2254\n",
"ok\n"
]
}
],
"source": [
"import json\n",
"import time\n",
"import csv\n",
"\n",
"filename = '../item.json'\n",
"item = {}\n",
"unit = {}\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for k,v in dict1.items():\n",
" item[k] = v\n",
"re_ta = {}\n",
"dict1 = {}\n",
"list1 = []\n",
"filename = 'data/石家庄2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20230505-sjz.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",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" list1.append(line)\n",
"#print(list1)\n",
"for result in list1:\n",
" user = str(result[2])\n",
" if user in dict1.keys():\n",
" \n",
" m_item = str(result[3]) \n",
" re_ta.setdefault(user,{}) \n",
" re_ta[user]['name'] = dict1[user]['name']\n",
" re_ta[user]['sex'] = dict1[user]['sex'] \n",
" re_ta[user]['部门'] = dict1[user]['unit']\n",
" item_name = item[m_item]['name']\n",
" re_ta[user].setdefault(item_name,{}) \n",
" score = int(result[4])/item[m_item]['divisor'] \n",
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
"print(len(re_ta))\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl) \n",
"print('ok')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6adeedfe-999a-47c2-aeed-fb4467b27026",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 39,
"id": "29ed0a03-72e1-4bee-8d00-95555f129d93",
"metadata": {
"execution": {
"iopub.execute_input": "2023-04-27T07:11:19.132911Z",
"iopub.status.busy": "2023-04-27T07:11:19.132425Z",
"iopub.status.idle": "2023-04-27T07:11:19.660183Z",
"shell.execute_reply": "2023-04-27T07:11:19.659444Z",
"shell.execute_reply.started": "2023-04-27T07:11:19.132880Z"
},
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
"title = ['编号','姓名','性别','单位','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"filename = 'data/石家庄2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl)\n",
" \n",
"list1 = []\n",
"for k, v in dict1.items():\n",
" list2 = []\n",
" list2.append(str(k).rjust(5,'0'))\n",
" list2.append(v['name']) \n",
" list2.append(dict2[k]['sex'])\n",
" list2.append(dict2[k]['unit']) \n",
" \n",
" for item in items:\n",
" if item in v.keys():\n",
" list2.append(v[item]['成绩']) \n",
" elif item =='name':\n",
" list2.append(v[item])\n",
" else:\n",
" list2.append('') \n",
" list1.append(list2)\n",
"filename = 'data/石家庄石化体测情况表.xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
"for row in list1:\n",
" sheet.append(row)\n",
" \n",
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "e5de157c-18e2-4a6a-bae8-3db88822b88f",
"metadata": {},
"source": [
"## 统计部门测试情况"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "57b22a08-554b-4b23-b98c-002b4608729f",
"metadata": {
"execution": {
"iopub.execute_input": "2023-04-26T09:42:34.825177Z",
"iopub.status.busy": "2023-04-26T09:42:34.824747Z",
"iopub.status.idle": "2023-04-26T09:42:34.875587Z",
"shell.execute_reply": "2023-04-26T09:42:34.874720Z",
"shell.execute_reply.started": "2023-04-26T09:42:34.825140Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'综合办公室(党委办公室)': 19, '销运管理部': 41, '企业管理部(法律事务部)': 12, '合资运行部': 27, '消防支队': 39, '设备工程部': 44, '党群文化部(宣传工团)': 9, '检验计量中心': 180, '发展计划部计划组': 11, '物资采购中心': 52, '炼油运行一部': 112, '审计管理部': 6, '发展计划部发展规划组': 12, '财务管理部': 18, '生产技术部': 35, '党委组织部(资源管理部)': 16, '安全环保部': 26, '储运运行部': 151, '化工运行部': 267, '信息中心': 18, '热电运行部': 92, '炼油运行三部': 127, '行政事务中心': 45, '电气仪表中心': 196, '炼油运行五部': 120, '水务运行部': 133, '编组站': 49, '炼油运行二部': 113, '炼油运行四部': 168, '纪委(监督部)': 2}\n"
]
}
],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"dict2 = {}\n",
"for k, v in dict1.items():\n",
" unit = v['部门']\n",
" dict2.setdefault(unit,0)\n",
" dict2[unit] = dict2[unit] + 1\n",
"print(dict2)\n",
"title =['单位','体测人数']\n",
"list1 = [] \n",
"for k, v in dict2.items():\n",
" list2 = []\n",
" list2 = [k,v]\n",
" list1.append(list2)\n",
"filename = 'data/石家庄测试名单部门情况(20230426).xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
"for row in list1:\n",
" sheet.append(row)\n",
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "187fc3c8-46f6-4d32-9b52-38efbf2403b4",
"metadata": {},
"source": [
"## 统计未测试人员名单"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "0001a577-3d89-4e3d-be07-51cc74e3640f",
"metadata": {
"execution": {
"iopub.execute_input": "2023-04-26T09:39:12.083561Z",
"iopub.status.busy": "2023-04-26T09:39:12.083234Z",
"iopub.status.idle": "2023-04-26T09:39:12.148788Z",
"shell.execute_reply": "2023-04-26T09:39:12.147956Z",
"shell.execute_reply.started": "2023-04-26T09:39:12.083534Z"
},
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"list1 = []\n",
"filename = 'data/石家庄2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl)\n",
"for k, v in dict2.items():\n",
" if k not in dict1.keys():\n",
" list1.append([k,v['name'],v['unit']])\n",
"filename = 'data/石家庄未测试名单(截至20230426).xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"title =['测试编号','姓名','单位']\n",
"sheet.append(title)\n",
"for row in list1:\n",
" sheet.append(row)\n",
"wb.save(filename)\n"
]
},
{
"cell_type": "markdown",
"id": "e0c0ada9-1df7-4c7e-9a56-7e224c636764",
"metadata": {},
"source": [
"## 生成查询文件"
]
},
{
"cell_type": "code",
"execution_count": 91,
"id": "e85c1be2-7859-4b7d-8f67-a9ad12d167d4",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T14:44:53.635480Z",
"iopub.status.busy": "2023-05-16T14:44:53.634628Z",
"iopub.status.idle": "2023-05-16T14:44:53.695874Z",
"shell.execute_reply": "2023-05-16T14:44:53.694856Z",
"shell.execute_reply.started": "2023-05-16T14:44:53.635438Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"import json\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"dict2 = {}\n",
"for k, v in dict1.items():\n",
" dict2[k] = v['name']\n",
"filename = 'data/shijiazhuang.json'\n",
"with open(filename, 'w') as fl:\n",
" json.dump(dict2, fl, ensure_ascii=False)\n",
"print('ok')\n",
" "
]
},
{
"cell_type": "markdown",
"id": "3a3ae88b-a59b-4403-9c98-685afe1f5268",
"metadata": {},
"source": [
"## 数据分析"
]
},
{
"cell_type": "markdown",
"id": "420510cf-c96b-4765-87c2-2911b1d4210a",
"metadata": {},
"source": [
"### 获取清理后报告数据"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "c9e4f67a-a34d-4c81-9ed7-9099d3f283f4",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T06:42:46.952331Z",
"iopub.status.busy": "2023-05-16T06:42:46.951922Z",
"iopub.status.idle": "2023-05-16T06:42:47.188427Z",
"shell.execute_reply": "2023-05-16T06:42:47.187703Z",
"shell.execute_reply.started": "2023-05-16T06:42:46.952303Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2253\n",
"['988', '2088', '2199', '1112', '2192', '523', '584', '170', '89', '1974', '1181', '1926', '846', '850', '2324', '2098', '2024', '2083', '1329', '1237']\n",
"2233\n",
"ok\n"
]
}
],
"source": [
"import json\n",
"import time\n",
"import csv\n",
"\n",
"filename = '../item.json'\n",
"item = {}\n",
"unit = {}\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for k,v in dict1.items():\n",
" item[k] = v\n",
"filename = 'data/石家庄2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"re_ta = {}\n",
"list1 = []\n",
"#print(\"\\n运动项目信息:\")\n",
"filename = 'data/places_result_sjz.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",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" list1.append(line)\n",
"#print(list1)\n",
"for result in list1:\n",
" user = str(result[2])\n",
" if user in dict1.keys():\n",
" \n",
" m_item = str(result[3]) \n",
" re_ta.setdefault(user,{}) \n",
" re_ta[user]['name'] = dict1[user]['name']\n",
" re_ta[user]['unit'] = dict1[user]['unit']\n",
" re_ta[user]['sex'] = dict1[user]['sex']\n",
" re_ta[user]['birth'] = dict1[user]['birth']\n",
" item_name = item[m_item]['name']\n",
" re_ta[user].setdefault(item_name,{}) \n",
" score = int(result[4])/item[m_item]['divisor'] \n",
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
" re_ta[user][item_name]['得分'] =result[5]\n",
"filename = 'data/result_石家庄.json'\n",
"print(len(re_ta))\n",
"liwai = []\n",
"for k, v in re_ta.items():\n",
" if (len(v)<8 and '身高' in v and '体重' in v) or (len(v)<7 and '身高' not in v and '体重' not in v) :\n",
" liwai.append(k)\n",
"print(liwai)\n",
"for k in liwai:\n",
" del re_ta[k]\n",
"print(len(re_ta))\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl) \n",
"print('ok')"
]
},
{
"cell_type": "markdown",
"id": "25bf52c2-0d84-4299-94af-5845d5156a93",
"metadata": {},
"source": [
"### 核对报告"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "3a8f7e29-aff1-4a5b-b31d-1c47aaf1e2fa",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T01:34:43.883914Z",
"iopub.status.busy": "2023-05-16T01:34:43.883060Z",
"iopub.status.idle": "2023-05-16T01:34:43.990826Z",
"shell.execute_reply": "2023-05-16T01:34:43.989773Z",
"shell.execute_reply.started": "2023-05-16T01:34:43.883871Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2388 {'name': '任宁', 'unit': '化工运行部', 'sex': '男', 'birth': '1982-01-16 00:00:00', '肺活量': {'成绩': '3292.0 毫升', '得分': '3'}, '选择反应时': {'成绩': '0.56 秒', '得分': '3'}, '握力': {'成绩': '41.6 千克', '得分': '2'}} \n",
"\n",
"986 {'name': '左少卿', 'unit': '炼油运行一部', 'sex': '男', 'birth': '1990-1-1', '肺活量': {'成绩': '2106.0 毫升', '得分': '0'}, '选择反应时': {'成绩': '0.665 秒', '得分': '1'}, '握力': {'成绩': '45.2 千克', '得分': '3'}} \n",
"\n",
"2053 {'name': '韩海涛', 'unit': '水务运行部', 'sex': '男', 'birth': '1971-2-1', '肺活量': {'成绩': '2414.0 毫升', '得分': '2'}, '握力': {'成绩': '38.8 千克', '得分': '2'}, '选择反应时': {'成绩': '0.591 秒', '得分': '3'}} \n",
"\n",
"2356 {'name': '张义生', 'unit': '编组站', 'sex': '男', 'birth': '1981-7-1', '肺活量': {'成绩': '1904.0 毫升', '得分': '0'}, '握力': {'成绩': '39.8 千克', '得分': '2'}, '选择反应时': {'成绩': '0.553 秒', '得分': '3'}} \n",
"\n",
"1974 {'name': '鲍英杰', 'unit': '热电运行部', 'sex': '男', 'birth': '1979-8-1', '肺活量': {'成绩': '4006.0 毫升', '得分': '4'}} \n",
"\n",
"1987 {'name': '贾宁', 'unit': '热电运行部', 'sex': '男', 'birth': '1979-1-1', '握力': {'成绩': '46.3 千克', '得分': '3'}, '单脚站立': {'成绩': '4.2 秒', '得分': '2'}, '选择反应时': {'成绩': '0.592 秒', '得分': '2'}} \n",
"\n"
]
}
],
"source": [
"import json\n",
"import time\n",
"import csv\n",
"import os,sys,shutil\n",
"import glob\n",
"\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"m_path = 'file/2023-04-30'\n",
"old = []\n",
"fls = glob.glob(f'{m_path}/*.pdf')\n",
"for fn in fls:\n",
" #old = os.path.basename(fn).split('.')[0].rjust(8,'0') \n",
" old.append(os.path.basename(fn).split('.')[0])\n",
"for k, v in dict1.items():\n",
" if k not in old and '身高' not in v.keys():\n",
" print(k,v,'\\n')"
]
},
{
"cell_type": "markdown",
"id": "54fb3c1b-b791-4502-a78f-89488d329a94",
"metadata": {},
"source": [
"### 计算人员年龄"
]
},
{
"cell_type": "code",
"execution_count": 49,
"id": "70a69705-908f-4c77-948c-c5c781707af5",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T07:18:56.549625Z",
"iopub.status.busy": "2023-05-16T07:18:56.548729Z",
"iopub.status.idle": "2023-05-16T07:18:56.718501Z",
"shell.execute_reply": "2023-05-16T07:18:56.717607Z",
"shell.execute_reply.started": "2023-05-16T07:18:56.549584Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"import json\n",
"import datetime\n",
"\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"for k, v in dict1.items():\n",
" birth = v['birth'].split()[0].split('-')\n",
" \n",
" nian = int(birth[0].strip())\n",
" yue = int(birth[1].strip())\n",
" ri = int(birth[2].strip())\n",
" #print(k,nian,yue,ri)\n",
" days = (datetime.date(2023, 4, 23)-datetime.date(nian,yue,ri)).days\n",
" v['age'] = round(days/365)\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict1, fl) \n",
"print('ok') "
]
},
{
"cell_type": "markdown",
"id": "a3027c15-aa68-4fb9-9e23-791fa2530209",
"metadata": {},
"source": [
"### 汇总人员信息及成绩"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "01a1c350-ae39-4610-b97d-8bcea11cac09",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"\n",
"\n",
"items = ['体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
"\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for k,v in dict1.items():\n",
" score = 0\n",
" i = 0\n",
" for k1,v1 in v.items(): \n",
" if k1 in items:\n",
" score = score + int(v1['得分'])\n",
" i+=1\n",
" dict1[k]['score'] = round(score/i,2) \n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict1, fl) \n",
"print('ok')"
]
},
{
"cell_type": "markdown",
"id": "3345d0c6-48b5-42c8-98ce-ccb66dd73f87",
"metadata": {},
"source": [
"### 计算测试等级"
]
},
{
"cell_type": "code",
"execution_count": 55,
"id": "69b5f5e5-04e4-4509-8518-b7fc54cd4e45",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T07:57:17.722569Z",
"iopub.status.busy": "2023-05-16T07:57:17.722163Z",
"iopub.status.idle": "2023-05-16T07:57:17.883835Z",
"shell.execute_reply": "2023-05-16T07:57:17.883079Z",
"shell.execute_reply.started": "2023-05-16T07:57:17.722541Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0~255分人数:779人,男性:678人,女性:101人\n",
"256~332分人数:1009人,男性:786人,女性:223人\n",
"333~367分人数:316人,男性:189人,女性:127人\n",
"368~500分人数:129人,男性:57人,女性:72人\n",
"ok\n"
]
}
],
"source": [
"import json\n",
"\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"dict2 = {}\n",
"dict2['不合格'] = [0,255]\n",
"dict2['合格'] = [256,332]\n",
"dict2['良好'] = [333,367]\n",
"dict2['优秀'] = [368,500]\n",
"\n",
"for k1, v1 in dict2.items():\n",
" di = v1[0]\n",
" gao = v1[1]\n",
" i = 0 \n",
" m = 0\n",
" f = 0\n",
" for k,v in dict1.items():\n",
" if int(v['score']*100) in range(di,gao+1):\n",
" dict1[k]['level'] = k1\n",
" i+=1\n",
" if v['sex'] == '男':\n",
" m = m +1\n",
" else:\n",
" f = f+1\n",
" print(f'{di}~{gao}分人数:{i}人,男性:{m}人,女性:{f}人')\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict1, fl) \n",
"print('ok')"
]
},
{
"cell_type": "markdown",
"id": "a87e51a1-e5c1-44c2-bc38-efbe108e92bb",
"metadata": {},
"source": [
"### 根据年龄汇总人员信息及成绩"
]
},
{
"cell_type": "code",
"execution_count": 57,
"id": "cd27296f-2412-4a77-8b74-676c7d0efb30",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T10:12:11.824773Z",
"iopub.status.busy": "2023-05-16T10:12:11.823933Z",
"iopub.status.idle": "2023-05-16T10:12:11.901112Z",
"shell.execute_reply": "2023-05-16T10:12:11.900078Z",
"shell.execute_reply.started": "2023-05-16T10:12:11.824732Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"20~24岁平均成绩:2.48分,人数:107人,男性:94人\n",
"25~29岁平均成绩:2.54分,人数:84人,男性:54人\n",
"30~34岁平均成绩:2.69分,人数:204人,男性:159人\n",
"35~39岁平均成绩:2.78分,人数:213人,男性:166人\n",
"40~44岁平均成绩:2.79分,人数:330人,男性:254人\n",
"45~49岁平均成绩:2.84分,人数:449人,男性:278人\n",
"50~54岁平均成绩:2.81分,人数:532人,男性:402人\n",
"55~59岁平均成绩:2.6分,人数:293人,男性:282人\n",
"60~69岁平均成绩:2.5分,人数:21人,男性:21人\n"
]
}
],
"source": [
"import json\n",
"\n",
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,69]]\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for item in nld:\n",
" di = item[0]\n",
" gao = item[1]\n",
" i = 1\n",
" score = 0\n",
" m = 0\n",
" f = 0\n",
" for k,v in dict1.items():\n",
" if v['age'] in range(di,gao+1):\n",
" score = score+v['score']\n",
" i+=1\n",
" if v['sex'] == '男':\n",
" m = m +1\n",
" \n",
" print(f'{di}~{gao}岁平均成绩:{round(score/i,2)}分,人数:{i-1}人,男性:{m}人')"
]
},
{
"cell_type": "code",
"execution_count": 87,
"id": "5dbdf7cf-9014-448a-ba9e-0aea8afbdd6f",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T12:45:45.673845Z",
"iopub.status.busy": "2023-05-16T12:45:45.673313Z",
"iopub.status.idle": "2023-05-16T12:45:45.751891Z",
"shell.execute_reply": "2023-05-16T12:45:45.750835Z",
"shell.execute_reply.started": "2023-05-16T12:45:45.673803Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"20~24岁平均成绩:2.46分,人数:94人\n",
"25~29岁平均成绩:2.36分,人数:54人\n",
"30~34岁平均成绩:2.58分,人数:159人\n",
"35~39岁平均成绩:2.7分,人数:166人\n",
"40~44岁平均成绩:2.71分,人数:254人\n",
"45~49岁平均成绩:2.71分,人数:278人\n",
"50~54岁平均成绩:2.69分,人数:402人\n",
"55~59岁平均成绩:2.59分,人数:282人\n",
"60~69岁平均成绩:2.5分,人数:21人\n"
]
}
],
"source": [
"import json\n",
"\n",
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,69]]\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for item in nld:\n",
" di = item[0]\n",
" gao = item[1]\n",
" i = 1\n",
" score = 0\n",
" m = 0\n",
" f = 0\n",
" for k,v in dict1.items():\n",
" if v['age'] in range(di,gao+1) and v['sex'] == '男':\n",
" score = score+v['score']\n",
" i+=1\n",
" \n",
" \n",
" print(f'{di}~{gao}岁平均成绩:{round(score/i,2)}分,人数:{i-1}人')"
]
},
{
"cell_type": "code",
"execution_count": 89,
"id": "cfbb33c5-6740-4226-a792-9ef32e32479e",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T12:47:14.940870Z",
"iopub.status.busy": "2023-05-16T12:47:14.940032Z",
"iopub.status.idle": "2023-05-16T12:47:15.016945Z",
"shell.execute_reply": "2023-05-16T12:47:15.015912Z",
"shell.execute_reply.started": "2023-05-16T12:47:14.940827Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"20~24岁平均成绩:2.41分,人数:13人\n",
"25~29岁平均成绩:2.77分,人数:30人\n",
"30~34岁平均成绩:3.02分,人数:45人\n",
"35~39岁平均成绩:2.99分,人数:47人\n",
"40~44岁平均成绩:3.03分,人数:76人\n",
"45~49岁平均成绩:3.02分,人数:171人\n",
"50~54岁平均成绩:3.18分,人数:130人\n",
"55~59岁平均成绩:2.61分,人数:11人\n",
"60~69岁平均成绩:0.0分,人数:0人\n"
]
}
],
"source": [
"import json\n",
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,69]]\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for item in nld:\n",
" di = item[0]\n",
" gao = item[1]\n",
" i = 1\n",
" score = 0\n",
" m = 0\n",
" f = 0\n",
" for k,v in dict1.items():\n",
" if v['age'] in range(di,gao+1) and v['sex'] == '女':\n",
" score = score+v['score']\n",
" i+=1\n",
" \n",
" \n",
" print(f'{di}~{gao}岁平均成绩:{round(score/i,2)}分,人数:{i-1}人')"
]
},
{
"cell_type": "markdown",
"id": "fc4ba2ba-f4c7-4934-8416-500ffd60e662",
"metadata": {},
"source": [
"### 生成平均成绩直方图"
]
},
{
"cell_type": "code",
"execution_count": 71,
"id": "fb5ccc15-b5bb-4379-88fb-acd8abbe48b6",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T11:00:12.386346Z",
"iopub.status.busy": "2023-05-16T11:00:12.385863Z",
"iopub.status.idle": "2023-05-16T11:00:12.736993Z",
"shell.execute_reply": "2023-05-16T11:00:12.736288Z",
"shell.execute_reply.started": "2023-05-16T11:00:12.386313Z"
},
"tags": []
},
"outputs": [],
"source": [
"import pygal\n",
"from pygal.style import Style\n",
"\n",
"custom_style = Style(\n",
" colors=('#9BC850', '#ffeb44', '#ff00ff'))\n",
"\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"pjf = []\n",
"for k, v in dict1.items(): \n",
" pjf.append(v['score'])\n",
"pjf.sort()\n",
"bar_chart = pygal.Bar(style=custom_style)\n",
"bar_chart.add('平均分',pjf) # Add some values\n",
"bar_chart.render_to_file('bar_chart.svg') "
]
},
{
"cell_type": "markdown",
"id": "8e7a45fc-94d3-468f-853a-e23573333c08",
"metadata": {},
"source": [
"### 计算平均成绩"
]
},
{
"cell_type": "code",
"execution_count": 77,
"id": "41714148-5130-4c83-805f-bb98dbb96dd6",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T11:14:05.569248Z",
"iopub.status.busy": "2023-05-16T11:14:05.568377Z",
"iopub.status.idle": "2023-05-16T11:14:05.634577Z",
"shell.execute_reply": "2023-05-16T11:14:05.633521Z",
"shell.execute_reply.started": "2023-05-16T11:14:05.569202Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"平均成绩:2.6583分,男性:1710人\n",
"平均成绩:3.064分,女性:523人\n",
"平均成绩:2.7533分,女性:2233人\n"
]
}
],
"source": [
"import json\n",
"\n",
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,69]]\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"i = 1\n",
"m = 0\n",
"f = 0\n",
"score = 0\n",
"t_score = 0\n",
"for k,v in dict1.items():\n",
" if v['sex'] == '男':\n",
" m = m +1\n",
" score = score+v['score']\n",
"print(f'平均成绩:{round(score/m,4)}分,男性:{m}人')\n",
"t_score = t_score + score\n",
"score = 0\n",
"for k,v in dict1.items():\n",
" if v['sex'] == '女':\n",
" f = f +1\n",
" score = score+v['score']\n",
"print(f'平均成绩:{round(score/f,4)}分,女性:{f}人')\n",
"t_score = t_score + score\n",
"print(f'平均成绩:{round(t_score/2233,4)}分,女性:2233人')"
]
},
{
"cell_type": "markdown",
"id": "4e854305-a22b-4a0a-a819-988a18424fe7",
"metadata": {},
"source": [
"### 计算测试等级"
]
},
{
"cell_type": "code",
"execution_count": 80,
"id": "de6fbd5b-2361-4207-8bf0-08652148b729",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T11:29:57.182599Z",
"iopub.status.busy": "2023-05-16T11:29:57.182200Z",
"iopub.status.idle": "2023-05-16T11:29:57.360092Z",
"shell.execute_reply": "2023-05-16T11:29:57.359361Z",
"shell.execute_reply.started": "2023-05-16T11:29:57.182571Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0~255分人数:779人,男性:678人,女性:101人\n",
"256~332分人数:1009人,男性:786人,女性:223人\n",
"333~367分人数:316人,男性:189人,女性:127人\n",
"368~500分人数:129人,男性:57人,女性:72人\n",
"ok\n"
]
}
],
"source": [
"import json\n",
"\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"dict2 = {}\n",
"dict2['不合格'] = [0,255]\n",
"dict2['合格'] = [256,332]\n",
"dict2['良好'] = [333,367]\n",
"dict2['优秀'] = [368,500]\n",
"\n",
"for k1, v1 in dict2.items():\n",
" di = v1[0]\n",
" gao = v1[1]\n",
" i = 0 \n",
" m = 0\n",
" f = 0\n",
" for k,v in dict1.items():\n",
" if int(v['score']*100) in range(di,gao+1):\n",
" dict1[k]['level'] = k1\n",
" i+=1\n",
" if v['sex'] == '男':\n",
" m = m +1\n",
" else:\n",
" f = f+1\n",
" print(f'{di}~{gao}分人数:{i}人,男性:{m}人,女性:{f}人')\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict1, fl) \n",
"print('ok')"
]
},
{
"cell_type": "markdown",
"id": "c5b55f21-8f31-4ae7-a75a-4e4bb5faed66",
"metadata": {},
"source": [
"### 计算各年龄段测试等级(男)"
]
},
{
"cell_type": "code",
"execution_count": 83,
"id": "eae7e34f-df88-4d46-bdb2-9f6bf4cfd357",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T11:52:33.551057Z",
"iopub.status.busy": "2023-05-16T11:52:33.550217Z",
"iopub.status.idle": "2023-05-16T11:52:33.628918Z",
"shell.execute_reply": "2023-05-16T11:52:33.627848Z",
"shell.execute_reply.started": "2023-05-16T11:52:33.551014Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"20-24 {'不合格': 4, '合格': 9, '良好': 0}\n",
"25-29 {'合格': 13, '优秀': 2, '不合格': 9, '良好': 6}\n",
"30-34 {'不合格': 8, '良好': 13, '合格': 20, '优秀': 4}\n",
"35-39 {'合格': 20, '良好': 13, '不合格': 9, '优秀': 5}\n",
"40-44 {'合格': 31, '不合格': 16, '良好': 17, '优秀': 12}\n",
"45-49 {'优秀': 20, '合格': 67, '良好': 46, '不合格': 38}\n",
"50-54 {'合格': 57, '不合格': 14, '良好': 30, '优秀': 29}\n",
"55-59 {'合格': 6, '不合格': 3, '优秀': 0, '良好': 2}\n",
"60-69 {'合格': 0, '优秀': 0, '不合格': 0, '良好': 0}\n"
]
}
],
"source": [
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,59],[60,69]]\n",
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"dict2 = {}\n",
"dict2['不合格'] = [0,255]\n",
"dict2['合格'] = [256,332]\n",
"dict2['良好'] = [333,367]\n",
"dict2['优秀'] = [368,500]\n",
"dict3 = {}\n",
"for item in nld:\n",
" di = item[0]\n",
" gao = item[1]\n",
" age = f'{di}-{gao}'\n",
" dict3.setdefault(age,{})\n",
" i = 0 \n",
" m = 0\n",
" f = 0\n",
" for k,v in dict1.items():\n",
" if v['age'] in range(di,gao+1): \n",
" dict3[age].setdefault(v['level'],0)\n",
" if v['sex'] == '女':\n",
" dict3[age][v['level']] = dict3[age][v['level']]+1\n",
" \n",
"for k, v in dict3.items():\n",
" print(k,v)"
]
},
{
"cell_type": "markdown",
"id": "83a11ed4-127e-497c-a8b0-431c7abb3840",
"metadata": {},
"source": [
"### 按照部门计算平均成绩"
]
},
{
"cell_type": "code",
"execution_count": 84,
"id": "33bfec2f-3f0c-40b3-81f6-cbbc4a0ce4b4",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T11:57:36.714514Z",
"iopub.status.busy": "2023-05-16T11:57:36.713654Z",
"iopub.status.idle": "2023-05-16T11:57:36.798934Z",
"shell.execute_reply": "2023-05-16T11:57:36.797944Z",
"shell.execute_reply.started": "2023-05-16T11:57:36.714470Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"综合办公室(党委办公室) 3.06 22\n",
"销运管理部 2.99 45\n",
"企业管理部(法律事务部) 2.84 12\n",
"合资运行部 2.9 27\n",
"消防支队 2.98 43\n",
"设备工程部 3.0 44\n",
"党群文化部(宣传工团) 2.98 10\n",
"检验计量中心 2.86 185\n",
"发展计划部计划组 3.03 12\n",
"物资采购中心 2.93 55\n",
"炼油运行一部 2.6 112\n",
"审计管理部 2.93 6\n",
"发展计划部发展规划组 2.99 13\n",
"财务管理部 3.03 17\n",
"生产技术部 2.85 37\n",
"党委组织部(资源管理部) 3.24 16\n",
"安全环保部 3.15 26\n",
"储运运行部 2.64 160\n",
"化工运行部 2.74 269\n",
"信息中心 2.95 17\n",
"电气仪表中心 2.86 226\n",
"热电运行部 2.5 91\n",
"炼油运行三部 2.58 140\n",
"行政事务中心 2.49 47\n",
"炼油运行五部 2.78 124\n",
"水务运行部 2.75 135\n",
"编组站 2.44 50\n",
"炼油运行二部 2.68 113\n",
"炼油运行四部 2.67 176\n",
"纪委(监督部) 3.0 3\n"
]
}
],
"source": [
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"depart = []\n",
"for k, v in dict1.items():\n",
" if v['unit'] not in depart:\n",
" depart.append(v['unit'])\n",
"\n",
"for item in depart:\n",
" score = 0\n",
" n = 0\n",
" for k, v in dict1.items():\n",
" if item == v['unit']:\n",
" score = score + v['score']\n",
" n = n +1 \n",
" print(item,round(score/n,2),n)\n",
" "
]
},
{
"cell_type": "markdown",
"id": "d28e91b4-3556-47a4-81a4-a3d44777e899",
"metadata": {},
"source": [
"### 计算各项目成绩"
]
},
{
"cell_type": "code",
"execution_count": 85,
"id": "1626c578-b38d-435b-8c08-45588cd44096",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T12:15:49.551456Z",
"iopub.status.busy": "2023-05-16T12:15:49.550669Z",
"iopub.status.idle": "2023-05-16T12:15:49.633599Z",
"shell.execute_reply": "2023-05-16T12:15:49.632661Z",
"shell.execute_reply.started": "2023-05-16T12:15:49.551420Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"体重 3.49\n",
"肺活量 3.26\n",
"握力 2.54\n",
"坐位体前屈 3.06\n",
"纵跳 1.9\n",
"俯卧撑 2.39\n",
"一分钟仰卧起坐 3.9\n",
"单脚站立 2.23\n",
"选择反应时 2.9\n",
"台阶指数 3.01\n"
]
}
],
"source": [
"filename = 'data/result_石家庄.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"items = ['体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
"for item in items:\n",
" score = 0\n",
" n = 0\n",
" for k, v in dict1.items():\n",
" if item in v.keys():\n",
" n = n + 1\n",
" score =score + int(v[item]['得分'])\n",
" print(item,round(score/n,2))"
]
},
{
"cell_type": "code",
"execution_count": 90,
"id": "25b5f474-1f2e-4d6b-a6d7-2c0427a9bcbf",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-16T14:14:45.541203Z",
"iopub.status.busy": "2023-05-16T14:14:45.540306Z",
"iopub.status.idle": "2023-05-16T14:14:45.551035Z",
"shell.execute_reply": "2023-05-16T14:14:45.549704Z",
"shell.execute_reply.started": "2023-05-16T14:14:45.541147Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'1': {'name': '齐新', 'phone': '13810412119'}, '2': {'name': '代盼盼', 'phone': '18811016592'}, '7': {'name': '陈建侨', 'phone': '18518668138'}, '8': {'name': '孟琳', 'phone': '13810582314'}, '15': {'name': '赵文静', 'phone': '18612218066'}, '16': {'name': '高艳丽', 'phone': '17746578620'}, '17': {'name': '魏腾飞', 'phone': '18519094064'}, '19': {'name': '杨爽', 'phone': '13911804937'}, '20': {'name': '杨静', 'phone': '15201222908'}, '21': {'name': '王京亚', 'phone': '15210034201'}, '22': {'name': '张笑寒', 'phone': '13811282007'}, '23': {'name': '周海苗', 'phone': '15811323860'}, '24': {'name': '胡颖', 'phone': '15901552680'}, '25': {'name': '孙鑫', 'phone': '15810028607'}, '26': {'name': '徐栋刚', 'phone': '13611378746'}, '27': {'name': '屈俊英', 'phone': '15321996557'}, '28': {'name': '侯然', 'phone': '15811321170'}, '29': {'name': '高梦珊', 'phone': '18310115505'}, '30': {'name': '王璐', 'phone': '18210908699'}, '31': {'name': '赵晨阳', 'phone': '13811750045'}, '32': {'name': '张子娣', 'phone': '13811679953'}, '33': {'name': '张昊翔', 'phone': '13699269376'}, '34': {'name': '霍东林', 'phone': '13701385970'}, '37': {'name': '刘鑫', 'phone': '13120475746'}, '39': {'name': '吴家硕', 'phone': '17600977328'}, '40': {'name': '田征', 'phone': '13552876727'}, '41': {'name': '张静瑶', 'phone': '13681188042'}, '42': {'name': '周维', 'phone': '13683093209'}, '43': {'name': '王芳', 'phone': '13439355291'}, '44': {'name': '刘静', 'phone': '13671067523'}, '45': {'name': '张翠萍', 'phone': '13426307538'}, '46': {'name': '郭晏辰', 'phone': '13522701405'}, '49': {'name': '王亚峰', 'phone': '13691445507'}, '50': {'name': '杨静', 'phone': '13436666818'}, '51': {'name': '刘海云', 'phone': '15011151011'}, '53': {'name': '李丽', 'phone': '13521299700'}, '54': {'name': '余华国', 'phone': '13611383112'}, '58': {'name': '叶红', 'phone': '13699107409'}, '59': {'name': '杨雪', 'phone': '13581675022'}, '60': {'name': '胡宇翔', 'phone': '18612251290'}, '61': {'name': '耿利群', 'phone': '13717616853'}, '62': {'name': '张丽侠', 'phone': '13716114708'}, '63': {'name': '郭萌萌', 'phone': '15811322896'}, '64': {'name': '刘然', 'phone': '13810646725'}, '65': {'name': '王芳', 'phone': '13811152058'}, '66': {'name': '李雪', 'phone': '18201450903'}, '67': {'name': '刘秋红', 'phone': '13581670255'}, '68': {'name': '罗琪', 'phone': '13693021978'}, '69': {'name': '刘影翠', 'phone': '13716611017'}, '70': {'name': '李芳', 'phone': '13720086106'}, '71': {'name': '王红晶', 'phone': '13911385423'}, '72': {'name': '翁田田', 'phone': '15210580711'}, '73': {'name': '宋丹', 'phone': '18610698277'}, '74': {'name': '焦阳', 'phone': '13691376452'}, '76': {'name': '孙科', 'phone': '13381073047'}, '78': {'name': '齐占先', 'phone': '13718162901'}, '79': {'name': '刘成', 'phone': '13901322542'}, '80': {'name': '尹玉岐', 'phone': '13911810030'}, '81': {'name': '祁俊', 'phone': '13911778826'}, '82': {'name': '王超', 'phone': '13691485486'}, '83': {'name': '肖国颖', 'phone': '13552568891'}, '84': {'name': '马欣欢', 'phone': '15901057009'}, '86': {'name': '宋新华', 'phone': '13683673008'}, '87': {'name': '李建坤', 'phone': '15010250252'}, '88': {'name': '李雪萌', 'phone': '13811680197'}, '90': {'name': '莱阳', 'phone': '18210672698'}, '92': {'name': '霍少博', 'phone': '15910351351'}, '93': {'name': '杜劲', 'phone': '13681129230'}, '94': {'name': '殷爽', 'phone': '13501210584'}, '95': {'name': '毛佳', 'phone': '15210691317'}, '96': {'name': '徐韬韫', 'phone': '15901441970'}, '97': {'name': '杨跃超', 'phone': '15910281728'}, '98': {'name': '张举', 'phone': '18610224503'}, '99': {'name': '蔺少华', 'phone': '18600655580'}, '100': {'name': '宁培', 'phone': '13810303077'}, '101': {'name': '朱影', 'phone': '15811174828'}, '102': {'name': '孙然', 'phone': '15810802850'}, '103': {'name': '叶文君', 'phone': '13716840153'}, '104': {'name': '刘旭', 'phone': '13651000624'}, '105': {'name': '闫超阔', 'phone': '18210273718'}, '108': {'name': '王君', 'phone': '13691332722'}, '109': {'name': '张秋瑾', 'phone': '13269560927'}, '110': {'name': '史维维', 'phone': '15010368255'}, '111': {'name': '张泽', 'phone': '15010234727'}, '112': {'name': '孙林', 'phone': '13520752811'}, '113': {'name': '王润生', 'phone': '13261988826'}, '114': {'name': '崔亚菲', 'phone': '13810979122'}, '115': {'name': '李雪娇', 'phone': '15910619124'}, '116': {'name': '柳建军', 'phone': '13011030093'}, '117': {'name': '孙学勇', 'phone': '13520765718'}, '118': {'name': '董兰兰', 'phone': '13910303323'}, '119': {'name': '陈娜', 'phone': '18510337879'}, '120': {'name': '杨帆', 'phone': '18610229696'}, '122': {'name': '张春贤', 'phone': '17310179107'}, '123': {'name': '张立伟', 'phone': '13911285239'}, '124': {'name': '李岩', 'phone': '15810525991'}, '126': {'name': '肖杰', 'phone': '13466726203'}, '127': {'name': '张振宇', 'phone': '15910659316'}, '128': {'name': '汪伟', 'phone': '13911416349'}, '129': {'name': '张晓银', 'phone': '13501239434'}, '130': {'name': '马玉桥', 'phone': '13683207236'}, '131': {'name': '吕灿', 'phone': '13269115851'}, '132': {'name': '于双双', 'phone': '18001370626'}, '133': {'name': '贾鹏', 'phone': '13581577666'}, '134': {'name': '张雪', 'phone': '13910212354'}, '135': {'name': '王迪', 'phone': '19800383262'}, '136': {'name': '兰法坡', 'phone': '13683298902'}, '137': {'name': '陆志刚', 'phone': '13716622494'}, '138': {'name': '张国虎', 'phone': '13651376603'}, '139': {'name': '张学超', 'phone': '13520253719'}, '140': {'name': '康玉林', 'phone': '13552112130'}, '141': {'name': '李满存', 'phone': '13552872968'}, '142': {'name': '赵金义', 'phone': '13366615285'}, '143': {'name': '刘劲松', 'phone': '15010832956'}, '144': {'name': '韩旭', 'phone': '17600988129'}, '147': {'name': '高洪影', 'phone': '13552119586'}, '148': {'name': '刘万凯', 'phone': '13683339037'}, '149': {'name': '王超', 'phone': '13911939930'}, '150': {'name': '张建杰', 'phone': '18511186138'}, '151': {'name': '薛贺', 'phone': '13691358158'}, '152': {'name': '张秀荣', 'phone': '13716648282'}, '153': {'name': '马小英', 'phone': '15910231342'}, '154': {'name': '任任', 'phone': '13910519224'}, '155': {'name': '王燕含', 'phone': '18601126504'}, '156': {'name': '王志博', 'phone': '17610603732'}, '157': {'name': '韦杰友', 'phone': '13521551136'}, '158': {'name': '李文业', 'phone': '13831351283'}, '159': {'name': '李炳忠', 'phone': '15245887158'}, '160': {'name': '李景文', 'phone': '13644589589'}, '161': {'name': '张慧锋', 'phone': '18790630680'}, '162': {'name': '张玉英', 'phone': '18201187087'}, '163': {'name': '魏铁', 'phone': '18500399231'}, '164': {'name': '李龙', 'phone': '18545428957'}, '165': {'name': '鲁丹', 'phone': '15910286571'}, '166': {'name': '王成才', 'phone': '13683325919'}, '167': {'name': '李亮', 'phone': '13021026178'}, '168': {'name': '刘素芳', 'phone': '13718625812'}, '169': {'name': '吕云霞', 'phone': '18901325393'}, '170': {'name': '段苏菲', 'phone': '13041038841'}, '171': {'name': '张泽强', 'phone': '13897829556'}, '172': {'name': '刘会强', 'phone': '13791542068'}, '173': {'name': '张建峰', 'phone': '13897829556'}, '174': {'name': '马东明', 'phone': '13716383150'}, '175': {'name': '李东峰', 'phone': '18811266311'}, '176': {'name': '田佳强', 'phone': '15650768161'}}\n"
]
}
],
"source": [
"filename = 'data/tiangongyuan.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"print(dict1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "178b485e-8ee2-4173-b7f5-fe2e875452ab",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}