fix(ALandML): fix output

This commit is contained in:
iridiumR 2022-09-21 14:54:18 +08:00
parent 3ffb351190
commit 70209af408
2 changed files with 129 additions and 110 deletions

View file

@ -10,7 +10,7 @@
"\n", "\n",
"|学号 |姓名 |\n", "|学号 |姓名 |\n",
"|----------|--------|\n", "|----------|--------|\n",
"|***REMOVED***|***REMOVED***|" "|***REMOVED***|江一和|"
] ]
}, },
{ {
@ -26,7 +26,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 42, "execution_count": 43,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -63,16 +63,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 44,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"['Linus Torvalds', 'Richard Stallman', 'Greg Kroah-Hartman']\n", "['Linus Torvalds', 'Richard Stallman', 'Greg Kroah-Hartman']\n"
"['Greg Kroah-Hartman', 'Linus Torvalds', 'Richard Stallman']\n",
"['Greg Kroah-Hartman', 'Linus Torvalds', 'Richard Stallman', 'Albert Einstein']\n"
] ]
} }
], ],
@ -83,9 +81,17 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 45,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['Greg Kroah-Hartman', 'Linus Torvalds', 'Richard Stallman']\n"
]
}
],
"source": [ "source": [
"names.sort()\n", "names.sort()\n",
"print(names)" "print(names)"
@ -93,9 +99,17 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 46,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['Greg Kroah-Hartman', 'Linus Torvalds', 'Richard Stallman', 'Albert Einstein']\n"
]
}
],
"source": [ "source": [
"names.append(\"Albert Einstein\")\n", "names.append(\"Albert Einstein\")\n",
"print(names)" "print(names)"
@ -103,7 +117,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 47,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -129,7 +143,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 11, "execution_count": 48,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -160,7 +174,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 49,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -198,7 +212,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 15, "execution_count": 50,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -242,7 +256,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 34, "execution_count": 51,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -294,7 +308,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 35, "execution_count": 52,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -333,7 +347,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 36, "execution_count": 53,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -373,7 +387,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 39, "execution_count": 54,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -400,7 +414,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 40, "execution_count": 55,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {

View file

@ -23,7 +23,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": 26,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -44,7 +44,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 27,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -60,7 +60,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": 28,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -100,101 +100,108 @@
" </thead>\n", " </thead>\n",
" <tbody>\n", " <tbody>\n",
" <tr>\n", " <tr>\n",
" <th>886</th>\n", " <th>0</th>\n",
" <td>887</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>Montvila, Rev. Juozas</td>\n",
" <td>male</td>\n",
" <td>27.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>211536</td>\n",
" <td>13.00</td>\n",
" <td>NaN</td>\n",
" <td>S</td>\n",
" </tr>\n",
" <tr>\n",
" <th>887</th>\n",
" <td>888</td>\n",
" <td>1</td>\n", " <td>1</td>\n",
" <td>1</td>\n",
" <td>Graham, Miss. Margaret Edith</td>\n",
" <td>female</td>\n",
" <td>19.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>112053</td>\n",
" <td>30.00</td>\n",
" <td>B42</td>\n",
" <td>S</td>\n",
" </tr>\n",
" <tr>\n",
" <th>888</th>\n",
" <td>889</td>\n",
" <td>0</td>\n", " <td>0</td>\n",
" <td>3</td>\n", " <td>3</td>\n",
" <td>Johnston, Miss. Catherine Helen \"Carrie\"</td>\n", " <td>Braund, Mr. Owen Harris</td>\n",
" <td>female</td>\n", " <td>male</td>\n",
" <td>NaN</td>\n", " <td>22.0</td>\n",
" <td>1</td>\n", " <td>1</td>\n",
" <td>2</td>\n", " <td>0</td>\n",
" <td>W./C. 6607</td>\n", " <td>A/5 21171</td>\n",
" <td>23.45</td>\n", " <td>7.2500</td>\n",
" <td>NaN</td>\n", " <td>NaN</td>\n",
" <td>S</td>\n", " <td>S</td>\n",
" </tr>\n", " </tr>\n",
" <tr>\n", " <tr>\n",
" <th>889</th>\n", " <th>1</th>\n",
" <td>890</td>\n", " <td>2</td>\n",
" <td>1</td>\n", " <td>1</td>\n",
" <td>1</td>\n", " <td>1</td>\n",
" <td>Behr, Mr. Karl Howell</td>\n", " <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
" <td>male</td>\n", " <td>female</td>\n",
" <td>26.0</td>\n", " <td>38.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n", " <td>0</td>\n",
" <td>0</td>\n", " <td>PC 17599</td>\n",
" <td>111369</td>\n", " <td>71.2833</td>\n",
" <td>30.00</td>\n", " <td>C85</td>\n",
" <td>C148</td>\n",
" <td>C</td>\n", " <td>C</td>\n",
" </tr>\n", " </tr>\n",
" <tr>\n", " <tr>\n",
" <th>890</th>\n", " <th>2</th>\n",
" <td>891</td>\n", " <td>3</td>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" <td>Heikkinen, Miss. Laina</td>\n",
" <td>female</td>\n",
" <td>26.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>STON/O2. 3101282</td>\n",
" <td>7.9250</td>\n",
" <td>NaN</td>\n",
" <td>S</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
" <td>female</td>\n",
" <td>35.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>113803</td>\n",
" <td>53.1000</td>\n",
" <td>C123</td>\n",
" <td>S</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>5</td>\n",
" <td>0</td>\n", " <td>0</td>\n",
" <td>3</td>\n", " <td>3</td>\n",
" <td>Dooley, Mr. Patrick</td>\n", " <td>Allen, Mr. William Henry</td>\n",
" <td>male</td>\n", " <td>male</td>\n",
" <td>32.0</td>\n", " <td>35.0</td>\n",
" <td>0</td>\n", " <td>0</td>\n",
" <td>0</td>\n", " <td>0</td>\n",
" <td>370376</td>\n", " <td>373450</td>\n",
" <td>7.75</td>\n", " <td>8.0500</td>\n",
" <td>NaN</td>\n", " <td>NaN</td>\n",
" <td>Q</td>\n", " <td>S</td>\n",
" </tr>\n", " </tr>\n",
" </tbody>\n", " </tbody>\n",
"</table>\n", "</table>\n",
"</div>" "</div>"
], ],
"text/plain": [ "text/plain": [
" PassengerId Survived Pclass Name \\\n", " PassengerId Survived Pclass \\\n",
"886 887 0 2 Montvila, Rev. Juozas \n", "0 1 0 3 \n",
"887 888 1 1 Graham, Miss. Margaret Edith \n", "1 2 1 1 \n",
"888 889 0 3 Johnston, Miss. Catherine Helen \"Carrie\" \n", "2 3 1 3 \n",
"889 890 1 1 Behr, Mr. Karl Howell \n", "3 4 1 1 \n",
"890 891 0 3 Dooley, Mr. Patrick \n", "4 5 0 3 \n",
"\n", "\n",
" Sex Age SibSp Parch Ticket Fare Cabin Embarked \n", " Name Sex Age SibSp \\\n",
"886 male 27.0 0 0 211536 13.00 NaN S \n", "0 Braund, Mr. Owen Harris male 22.0 1 \n",
"887 female 19.0 0 0 112053 30.00 B42 S \n", "1 Cumings, Mrs. John Bradley (Florence Briggs Th... female 38.0 1 \n",
"888 female NaN 1 2 W./C. 6607 23.45 NaN S \n", "2 Heikkinen, Miss. Laina female 26.0 0 \n",
"889 male 26.0 0 0 111369 30.00 C148 C \n", "3 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 \n",
"890 male 32.0 0 0 370376 7.75 NaN Q " "4 Allen, Mr. William Henry male 35.0 0 \n",
"\n",
" Parch Ticket Fare Cabin Embarked \n",
"0 0 A/5 21171 7.2500 NaN S \n",
"1 0 PC 17599 71.2833 C85 C \n",
"2 0 STON/O2. 3101282 7.9250 NaN S \n",
"3 0 113803 53.1000 C123 S \n",
"4 0 373450 8.0500 NaN S "
] ]
}, },
"execution_count": 9, "execution_count": 28,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -206,7 +213,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 29,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -340,7 +347,7 @@
"890 male 32.0 0 0 370376 7.75 NaN Q " "890 male 32.0 0 0 370376 7.75 NaN Q "
] ]
}, },
"execution_count": 10, "execution_count": 29,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -358,7 +365,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 30,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -383,7 +390,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13, "execution_count": 31,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -640,7 +647,7 @@
"[891 rows x 11 columns]" "[891 rows x 11 columns]"
] ]
}, },
"execution_count": 13, "execution_count": 31,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -658,7 +665,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 14, "execution_count": 32,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -679,7 +686,7 @@
"dtype: bool" "dtype: bool"
] ]
}, },
"execution_count": 14, "execution_count": 32,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -697,15 +704,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 15, "execution_count": 33,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"80.0\n", "80.0\n"
"0.42\n"
] ]
} }
], ],
@ -715,7 +721,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 16, "execution_count": 34,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -739,7 +745,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 17, "execution_count": 35,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -765,15 +771,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 24, "execution_count": 36,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"male:0.18890814558058924\n", "male:0.18890814558058924\n"
"female: 0.7420382165605095\n"
] ]
} }
], ],
@ -788,7 +793,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 25, "execution_count": 37,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -816,7 +821,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 19, "execution_count": 38,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1055,7 +1060,7 @@
"[891 rows x 12 columns]" "[891 rows x 12 columns]"
] ]
}, },
"execution_count": 19, "execution_count": 38,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -1073,7 +1078,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 20, "execution_count": 39,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1082,7 +1087,7 @@
"<AxesSubplot: ylabel='Frequency'>" "<AxesSubplot: ylabel='Frequency'>"
] ]
}, },
"execution_count": 20, "execution_count": 39,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
}, },
@ -1110,7 +1115,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 21, "execution_count": 40,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1119,7 +1124,7 @@
"<AxesSubplot: xlabel='Age', ylabel='Fare'>" "<AxesSubplot: xlabel='Age', ylabel='Fare'>"
] ]
}, },
"execution_count": 21, "execution_count": 40,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
}, },