This commit is contained in:
512song@sina.com committed 2022-12-15 13:24:54 +08:00
1 parent a039732d62
commit 84d41889d8
1 file changed
+12 -11
+12 -11
View File
@@ -198,15 +198,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 61, "execution_count": 98,
"id": "f32b266a-7e46-4703-ab61-7cbbc81b5ab1", "id": "f32b266a-7e46-4703-ab61-7cbbc81b5ab1",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2022-12-11T05:22:41.852604Z", "iopub.execute_input": "2022-12-15T01:23:46.345354Z",
"iopub.status.busy": "2022-12-11T05:22:41.852315Z", "iopub.status.busy": "2022-12-15T01:23:46.344556Z",
"iopub.status.idle": "2022-12-11T05:22:41.865812Z", "iopub.status.idle": "2022-12-15T01:23:46.364220Z",
"shell.execute_reply": "2022-12-11T05:22:41.864367Z", "shell.execute_reply": "2022-12-15T01:23:46.363538Z",
"shell.execute_reply.started": "2022-12-11T05:22:41.852578Z" "shell.execute_reply.started": "2022-12-15T01:23:46.345276Z"
}, },
"tags": [] "tags": []
}, },
@@ -216,8 +216,7 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"[25.9, 31.5, 38.6, 44.0, 50.8]\n", "[25.9, 31.5, 38.6, 44.0, 50.8]\n",
"25.9\n", "5\n"
"0\n"
] ]
} }
], ],
@@ -233,7 +232,7 @@
" dict1 = json.load(fl) \n", " dict1 = json.load(fl) \n",
"person = dict1['person']\n", "person = dict1['person']\n",
"criteria = dict1['criteria']\n", "criteria = dict1['criteria']\n",
"data = {'name':'张三','sex':'M','age':59,'item':'PowerfullGrip','result':12.0}\n", "data = {'name':'张三','sex':'M','age':59,'item':'PowerfullGrip','result':51.0}\n",
"info = data['sex']+str(data['age'])\n", "info = data['sex']+str(data['age'])\n",
"bz = person[info]\n", "bz = person[info]\n",
"mx = criteria[bz][data['item']]\n", "mx = criteria[bz][data['item']]\n",
@@ -245,8 +244,10 @@
" print(bz1)\n", " print(bz1)\n",
" score = mx.index(bz1,0)\n", " score = mx.index(bz1,0)\n",
" break\n", " break\n",
"if score == -1:\n", " else:\n",
" score = 5\n", " score = 5\n",
"#if score == -1:\n",
" # score = 5\n",
"print(score)" "print(score)"
] ]
}, },