This commit is contained in:
512song committed 2022-06-22 17:22:33 +08:00
commit 2d6d1fef55
5 files changed
+743 -558

No files matched your search

+41 -41
View File
@@ -786,7 +786,6 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": [] "tags": []
}, },
"source": [ "source": [
@@ -845,15 +844,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 20, "execution_count": null,
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2021-12-17T01:17:00.335807Z",
"iopub.status.busy": "2021-12-17T01:17:00.334807Z",
"iopub.status.idle": "2021-12-17T01:17:00.469071Z",
"shell.execute_reply": "2021-12-17T01:17:00.469071Z",
"shell.execute_reply.started": "2021-12-17T01:17:00.335807Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
@@ -891,15 +883,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 22, "execution_count": null,
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2021-12-17T01:40:10.503538Z",
"iopub.status.busy": "2021-12-17T01:40:10.503538Z",
"iopub.status.idle": "2021-12-17T01:40:10.673044Z",
"shell.execute_reply": "2021-12-17T01:40:10.672043Z",
"shell.execute_reply.started": "2021-12-17T01:40:10.503538Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
@@ -934,15 +919,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 25, "execution_count": null,
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2021-12-17T02:50:20.560344Z",
"iopub.status.busy": "2021-12-17T02:50:20.560344Z",
"iopub.status.idle": "2021-12-17T02:50:21.226478Z",
"shell.execute_reply": "2021-12-17T02:50:21.226478Z",
"shell.execute_reply.started": "2021-12-17T02:50:20.560344Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
@@ -996,15 +974,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 27, "execution_count": null,
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2021-12-17T03:08:55.050632Z",
"iopub.status.busy": "2021-12-17T03:08:55.050632Z",
"iopub.status.idle": "2021-12-17T03:08:55.843287Z",
"shell.execute_reply": "2021-12-17T03:08:55.843287Z",
"shell.execute_reply.started": "2021-12-17T03:08:55.050632Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
@@ -1050,15 +1021,8 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 29, "execution_count": null,
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2021-12-17T03:18:41.399609Z",
"iopub.status.busy": "2021-12-17T03:18:41.398609Z",
"iopub.status.idle": "2021-12-17T03:18:41.467625Z",
"shell.execute_reply": "2021-12-17T03:18:41.466624Z",
"shell.execute_reply.started": "2021-12-17T03:18:41.399609Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
@@ -1166,6 +1130,35 @@
"\n" "\n"
] ]
}, },
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## excel数据读取"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import openpyxl\n",
"import json\n",
"\n",
"filename = 'data/长岭全成绩.xlsx'\n",
"wb = openpyxl.load_workbook(filename)\n",
"sheet = wb.active\n",
"data1 =list(sheet.values)\n",
"del data1[0]\n",
"print(data1)\n",
"#for data in data1:\n",
"# print(data)\n",
"\n"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
@@ -1186,6 +1179,13 @@
"print(collist)" "print(collist)"
] ]
}, },
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
+36
View File
@@ -64,6 +64,42 @@
"#print(dict1)" "#print(dict1)"
] ]
}, },
{
"cell_type": "markdown",
"id": "bbf0b425-c0ce-4608-ae52-85a78ddcd6c0",
"metadata": {},
"source": [
"## 批量更换扩展名"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "2c2bd1d1-4d84-4639-ba20-c97c218ae275",
"metadata": {
"execution": {
"iopub.execute_input": "2022-05-06T14:01:25.901198Z",
"iopub.status.busy": "2022-05-06T14:01:25.900687Z",
"iopub.status.idle": "2022-05-06T14:01:25.911729Z",
"shell.execute_reply": "2022-05-06T14:01:25.910606Z",
"shell.execute_reply.started": "2022-05-06T14:01:25.901153Z"
},
"tags": []
},
"outputs": [],
"source": [
"import glob\n",
"import os,shutil\n",
"\n",
"filepath = 'file/yimo/'\n",
"old = 'SGF'\n",
"new = 'sgf'\n",
"files = glob.glob(f'{filepath}*.{old}')\n",
"for f in files:\n",
" new_file =os.path.splitext(f)[0]+'.'+new\n",
" os.rename(f,new_file)"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "69712868-6786-430b-8591-f6828d781588", "id": "69712868-6786-430b-8591-f6828d781588",
+2 -51
View File
@@ -18,59 +18,10 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 80, "execution_count": null,
"id": "be2371be-89f5-4879-82a9-4a1d9e6376d3", "id": "be2371be-89f5-4879-82a9-4a1d9e6376d3",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"1 南京中医药大学 中医学(本硕连读5+3一体化) 11019\n",
"2 天津医科大学 预防医学 11108\n",
"3 哈尔滨医科大学 临床医学 11227\n",
"4 空军军医大学 基础医学 11232\n",
"5 南京医科大学 预防医学 11275\n",
"6 温州医科大学 眼视光医学(5+3一体化) 11564\n",
"7 上海中医药大学 中医学(5+3一体化针灸推拿英语方向) 11620\n",
"8 兰州大学 临床医学类 11662\n",
"9 天津中医药大学 中医学(5+3一体化) 11825\n",
"10 哈尔滨医科大学 临床医学(5+3一体化,儿科学硕士) 11837\n",
"11 温州医科大学 临床医学(5+3一体化) 11869\n",
"12 东北大学 智能医学工程 11916\n",
"13 海军军医大学 中医学(中医临床医师) 11955\n",
"14 苏州大学 预防医学 11991\n",
"15 暨南大学 临床医学 12045\n",
"16 中国医科大学 医学影像学 12059\n",
"17 南昌大学 临床医学 12252\n",
"18 天津医科大学 医学影像技术 12272\n",
"19 吉林大学 预防医学 12320\n",
"20 南京航空航天大学 生物医学工程 12504\n",
"21 江南大学 临床医学 12526\n",
"22 广州中医药大学 中医学(5+3一体化) 12715\n",
"23 中国医科大学 基础医学 12755\n",
"24 重庆医科大学 医学影像学 12784\n",
"25 大连医科大学 临床医学(5+3一体化) 13012\n",
"26 天津医科大学 智能医学工程 13103\n",
"27 南京中医药大学 中医学 13301\n",
"28 温州医科大学 眼视光医学 13370\n",
"29 天津医科大学 医学检验技术 13371\n",
"30 天津医科大学 生物医学工程 13396\n",
"31 温州医科大学 临床医学 13421\n",
"32 中国医科大学 预防医学 13769\n",
"33 汕头大学 临床医学(5+3一体化) 13808\n",
"34 郑州大学 临床医学类 13981\n",
"35 郑州大学 口腔医学 14147\n",
"36 南方医科大学 基础医学 14160\n",
"37 哈尔滨医科大学 基础医学 14331\n",
"38 南方医科大学 预防医学 14366\n",
"39 大连医科大学 临床医学 14423\n",
"40 西北大学 临床医学 14492\n",
"41 天津中医药大学 中医学(5+3一体化中医儿科学) 14708\n",
"42 南京医科大学 智能医学工程 14721\n"
]
}
],
"source": [ "source": [
"import pymongo\n", "import pymongo\n",
"import re\n", "import re\n",
+157 -3
View File
@@ -3,8 +3,7 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"tags": [], "tags": []
"toc-hr-collapsed": true
}, },
"source": [ "source": [
"# 高考志愿管理" "# 高考志愿管理"
@@ -80,6 +79,161 @@
"\n" "\n"
] ]
}, },
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2021年全国高等学校信息更新"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2021年全国高等学校信息导出至json文件"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"execution": {
"iopub.execute_input": "2022-06-15T07:00:27.890983Z",
"iopub.status.busy": "2022-06-15T07:00:27.890444Z",
"iopub.status.idle": "2022-06-15T07:00:28.430955Z",
"shell.execute_reply": "2022-06-15T07:00:28.429949Z",
"shell.execute_reply.started": "2022-06-15T07:00:27.890936Z"
},
"tags": []
},
"outputs": [],
"source": [
"import openpyxl\n",
"import json\n",
"\n",
"filename = 'data/2021年全国普通高等学校名单.xlsx'\n",
"wb = openpyxl.load_workbook(filename)\n",
"sheet = wb.active\n",
"data1 =list(sheet.values)\n",
"del data1[0:3]\n",
"i = 1\n",
"dict1 = {}\n",
"for items in data1:\n",
" list1 = (items[1],str(items[2]),items[3],items[4],items[5],items[6])\n",
" dict1[i] = list1\n",
" i += 1 \n",
"with open('data/2021年全国普通高等学校名单.json','w') as fl2:\n",
" json.dump(dict1,fl2) \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 整理2021年全国高等学校信息"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"execution": {
"iopub.execute_input": "2022-06-15T08:26:50.903511Z",
"iopub.status.busy": "2022-06-15T08:26:50.902972Z",
"iopub.status.idle": "2022-06-15T08:26:50.972239Z",
"shell.execute_reply": "2022-06-15T08:26:50.971224Z",
"shell.execute_reply.started": "2022-06-15T08:26:50.903463Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"河北工业职业技术大学导入成功!\n",
"河北科技工程职业技术大学导入成功!\n",
"河北石油职业技术大学导入成功!\n",
"邢台应用技术职业学院导入成功!\n",
"山西工程科技职业大学导入成功!\n",
"吉林通用航空职业技术学院导入成功!\n",
"通化医药健康职业学院导入成功!\n",
"上海南湖职业技术学院导入成功!\n",
"浙江药科职业大学导入成功!\n",
"浙江金华科贸职业技术学院导入成功!\n",
"宿州航空职业学院导入成功!\n",
"和君职业学院导入成功!\n",
"滨州科技职业学院导入成功!\n",
"洛阳文化旅游职业学院导入成功!\n",
"周口文理职业学院导入成功!\n",
"信阳艺术职业学院导入成功!\n",
"郑州城建职业学院导入成功!\n",
"郑州医药健康职业学院导入成功!\n",
"湖北孝感美珈职业学院导入成功!\n",
"广州幼儿师范高等专科学校导入成功!\n",
"广东汕头幼儿师范高等专科学校导入成功!\n",
"广东梅州职业技术学院导入成功!\n",
"广东潮州卫生健康职业学院导入成功!\n",
"广东云浮中医药职业学院导入成功!\n",
"广东肇庆航空职业学院导入成功!\n",
"广西农业职业技术大学导入成功!\n",
"防城港职业技术学院导入成功!\n",
"广西信息职业技术学院导入成功!\n",
"广西农业工程职业技术学院导入成功!\n",
"北海康养职业学院导入成功!\n",
"重庆工信职业学院导入成功!\n",
"甘孜职业学院导入成功!\n",
"自贡职业技术学院导入成功!\n",
"贵阳康养职业大学导入成功!\n",
"贵州文化旅游职业学院导入成功!\n",
"宝鸡中北职业学院导入成功!\n",
"兰州石化职业技术大学导入成功!\n",
"兰州资源环境职业技术大学导入成功!\n",
"兰州航空职业技术学院导入成功!\n",
"白银希望职业技术学院导入成功!\n"
]
}
],
"source": [
"import openpyxl\n",
"import json\n",
"import pymongo\n",
"\n",
"\n",
"filename = 'data/2021年全国普通高等学校名单.json'\n",
"with open(filename,'r') as fl:\n",
" m_xx = json.load(fl)\n",
"\n",
"myclient = pymongo.MongoClient('mongodb://localhost:27017/')\n",
"mydb = myclient[\"gaokao\"]\n",
"mycol = mydb[\"college_2021\"]\n",
"\n",
"m_col = {}\n",
"\n",
"\n",
"for x in mycol.find({\"id_code\":{'$exists': 'true'}},{\"_id\": 0, \"id_code\": 1, \"name\": 1}):\n",
" m_col[x['id_code']] = x['name']\n",
"#print(m_col.keys())\n",
"for k, v in m_xx.items():\n",
" m_code = v[1]\n",
" #print(m_code)\n",
" if m_code not in m_col.keys():\n",
" dict1 = {}\n",
" dict1['id_code'] = v[1]\n",
" dict1['name'] = v[0]\n",
" dict1['charge'] = v[2]\n",
" dict1['city'] = v[3]\n",
" dict1['grade'] = v[4]\n",
" dict1['note'] = v[5]\n",
" mycol.insert_one(dict1) \n",
" print(dict1['name'] + '导入成功!')\n",
" #print(v[0],v[1])\n",
" \n",
"\n",
"\n",
" "
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
@@ -602,7 +756,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
+507 -463
View File
File diff suppressed because it is too large. Load diff