20240822
This commit is contained in:
1 parent
28b26205f2
commit
a029e8b3a6
2 files changed
+99
-17
No files matched your search
+62
-11
@@ -435,9 +435,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 60,
|
||||||
"id": "9b801085-ca98-4958-8dcc-bcd9985fcd4b",
|
"id": "9b801085-ca98-4958-8dcc-bcd9985fcd4b",
|
||||||
"metadata": {},
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-08-20T04:29:28.410551Z",
|
||||||
|
"iopub.status.busy": "2025-08-20T04:29:28.403719Z",
|
||||||
|
"iopub.status.idle": "2025-08-20T04:29:28.443048Z",
|
||||||
|
"shell.execute_reply": "2025-08-20T04:29:28.440751Z",
|
||||||
|
"shell.execute_reply.started": "2025-08-20T04:29:28.410496Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
@@ -453,7 +461,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"list1 = []\n",
|
"list1 = []\n",
|
||||||
"filename = 'data/survey_records_20250814.csv'\n",
|
"filename = 'data/survey_records_20250820.csv'\n",
|
||||||
"with open(filename,'r',newline='') as csv_file:\n",
|
"with open(filename,'r',newline='') as csv_file:\n",
|
||||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||||
" header = next(fl) \n",
|
" header = next(fl) \n",
|
||||||
@@ -542,19 +550,33 @@
|
|||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "19c6e8b6-2663-447d-884b-a22af3944c71",
|
"id": "19c6e8b6-2663-447d-884b-a22af3944c71",
|
||||||
"metadata": {
|
"metadata": {},
|
||||||
"jp-MarkdownHeadingCollapsed": true
|
|
||||||
},
|
|
||||||
"source": [
|
"source": [
|
||||||
"## 计算中医体质并导出"
|
"## 计算中医体质并导出"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 62,
|
||||||
"id": "e233e6c3-9c3f-42c7-8057-012bbcfe8b26",
|
"id": "e233e6c3-9c3f-42c7-8057-012bbcfe8b26",
|
||||||
"metadata": {},
|
"metadata": {
|
||||||
"outputs": [],
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-08-20T04:29:47.260065Z",
|
||||||
|
"iopub.status.busy": "2025-08-20T04:29:47.255846Z",
|
||||||
|
"iopub.status.idle": "2025-08-20T04:29:47.343088Z",
|
||||||
|
"shell.execute_reply": "2025-08-20T04:29:47.342363Z",
|
||||||
|
"shell.execute_reply.started": "2025-08-20T04:29:47.260018Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"ok\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"import json\n",
|
"import json\n",
|
||||||
@@ -700,7 +722,7 @@
|
|||||||
" list3.append(item)\n",
|
" list3.append(item)\n",
|
||||||
" list2.append(list3)\n",
|
" list2.append(list3)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/南化第二次问卷明细表.xlsx'\n",
|
"filename = 'data/南化第二次问卷明细表(截至20250820).xlsx'\n",
|
||||||
"wb = openpyxl.Workbook()\n",
|
"wb = openpyxl.Workbook()\n",
|
||||||
"sheet = wb.active\n",
|
"sheet = wb.active\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -1059,8 +1081,37 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 55,
|
||||||
"id": "221b35dc-3a17-4950-993c-b634ee9a53cf",
|
"id": "221b35dc-3a17-4950-993c-b634ee9a53cf",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-08-15T00:53:31.414664Z",
|
||||||
|
"iopub.status.busy": "2025-08-15T00:53:31.413959Z",
|
||||||
|
"iopub.status.idle": "2025-08-15T00:53:32.212146Z",
|
||||||
|
"shell.execute_reply": "2025-08-15T00:53:32.211576Z",
|
||||||
|
"shell.execute_reply.started": "2025-08-15T00:53:31.414598Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from spire.pdf.common import *\n",
|
||||||
|
"from spire.pdf import *\n",
|
||||||
|
"\n",
|
||||||
|
"# 创建PdfDocument类的实例\n",
|
||||||
|
"pdf = PdfDocument()\n",
|
||||||
|
"\n",
|
||||||
|
"# 加载PDF文档\n",
|
||||||
|
"pdf.LoadFromFile(\"file/南化体重/new/1782596-唐荣.pdf\")\n",
|
||||||
|
"\n",
|
||||||
|
"# 将PDF转换为Markdown文件\n",
|
||||||
|
"pdf.SaveToFile(\"PDF转Markdown.md\", FileFormat.Markdown)\n",
|
||||||
|
"pdf.Close()\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "1b9d4042-5e73-44e3-8079-eee2c5be1858",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": []
|
||||||
|
|||||||
+37
-6
@@ -10,12 +10,27 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 2,
|
||||||
"id": "bbba6efc-73cd-4db6-bae7-014724fee731",
|
"id": "bbba6efc-73cd-4db6-bae7-014724fee731",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-08-14T12:48:54.906761Z",
|
||||||
|
"iopub.status.busy": "2025-08-14T12:48:54.906261Z",
|
||||||
|
"iopub.status.idle": "2025-08-14T12:48:55.181497Z",
|
||||||
|
"shell.execute_reply": "2025-08-14T12:48:55.180926Z",
|
||||||
|
"shell.execute_reply.started": "2025-08-14T12:48:54.906723Z"
|
||||||
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"1698 ok\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"import json\n",
|
"import json\n",
|
||||||
@@ -42,7 +57,7 @@
|
|||||||
" \n",
|
" \n",
|
||||||
" dict1['birth'] = str(sheet.cell(n, 5).value).replace('/','-').split(' ')[0] \n",
|
" dict1['birth'] = str(sheet.cell(n, 5).value).replace('/','-').split(' ')[0] \n",
|
||||||
" person[code] = dict1\n",
|
" person[code] = dict1\n",
|
||||||
"filename = 'data/宁夏能化人员.json'\n",
|
"filename = 'data/宁夏能化人员-1.json'\n",
|
||||||
"with open(filename, 'w') as fl:\n",
|
"with open(filename, 'w') as fl:\n",
|
||||||
" json.dump(person, fl, ensure_ascii=False)\n",
|
" json.dump(person, fl, ensure_ascii=False)\n",
|
||||||
"print(len(person),'ok')"
|
"print(len(person),'ok')"
|
||||||
@@ -493,10 +508,26 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 1,
|
||||||
"id": "d31020be-c9c0-404f-8e0b-f8f507385f48",
|
"id": "d31020be-c9c0-404f-8e0b-f8f507385f48",
|
||||||
"metadata": {},
|
"metadata": {
|
||||||
"outputs": [],
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-08-14T12:28:32.225197Z",
|
||||||
|
"iopub.status.busy": "2025-08-14T12:28:32.224475Z",
|
||||||
|
"iopub.status.idle": "2025-08-14T12:28:32.933373Z",
|
||||||
|
"shell.execute_reply": "2025-08-14T12:28:32.932821Z",
|
||||||
|
"shell.execute_reply.started": "2025-08-14T12:28:32.225127Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"ok\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
|
|||||||
Reference in new issue
Block a user