diff --git a/AIandML/e1_python_basics/e1.0_python.ipynb b/AIandML/e1_python_basics/e1.0_python.ipynb index 7952002..d07eff5 100644 --- a/AIandML/e1_python_basics/e1.0_python.ipynb +++ b/AIandML/e1_python_basics/e1.0_python.ipynb @@ -10,7 +10,7 @@ "\n", "|学号 |姓名 |\n", "|----------|--------|\n", - "|***REMOVED***|***REMOVED***|" + "|***REMOVED***|江一和|" ] }, { @@ -26,7 +26,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 43, "metadata": {}, "outputs": [ { @@ -63,16 +63,14 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 44, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "['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" + "['Linus Torvalds', 'Richard Stallman', 'Greg Kroah-Hartman']\n" ] } ], @@ -83,9 +81,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 45, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Greg Kroah-Hartman', 'Linus Torvalds', 'Richard Stallman']\n" + ] + } + ], "source": [ "names.sort()\n", "print(names)" @@ -93,9 +99,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 46, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Greg Kroah-Hartman', 'Linus Torvalds', 'Richard Stallman', 'Albert Einstein']\n" + ] + } + ], "source": [ "names.append(\"Albert Einstein\")\n", "print(names)" @@ -103,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 47, "metadata": {}, "outputs": [ { @@ -129,7 +143,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -160,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 49, "metadata": {}, "outputs": [ { @@ -198,7 +212,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 50, "metadata": {}, "outputs": [ { @@ -242,7 +256,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 51, "metadata": {}, "outputs": [ { @@ -294,7 +308,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 52, "metadata": {}, "outputs": [ { @@ -333,7 +347,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 53, "metadata": {}, "outputs": [ { @@ -373,7 +387,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 54, "metadata": {}, "outputs": [ { @@ -400,7 +414,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 55, "metadata": {}, "outputs": [ { diff --git a/AIandML/e1_python_basics/e1.3_pandas.ipynb b/AIandML/e1_python_basics/e1.3_pandas.ipynb index 66993ec..7d8a552 100644 --- a/AIandML/e1_python_basics/e1.3_pandas.ipynb +++ b/AIandML/e1_python_basics/e1.3_pandas.ipynb @@ -23,7 +23,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -100,101 +100,108 @@ " \n", " \n", " \n", - " 886\n", - " 887\n", - " 0\n", - " 2\n", - " Montvila, Rev. Juozas\n", - " male\n", - " 27.0\n", - " 0\n", - " 0\n", - " 211536\n", - " 13.00\n", - " NaN\n", - " S\n", - " \n", - " \n", - " 887\n", - " 888\n", + " 0\n", " 1\n", - " 1\n", - " Graham, Miss. Margaret Edith\n", - " female\n", - " 19.0\n", - " 0\n", - " 0\n", - " 112053\n", - " 30.00\n", - " B42\n", - " S\n", - " \n", - " \n", - " 888\n", - " 889\n", " 0\n", " 3\n", - " Johnston, Miss. Catherine Helen \"Carrie\"\n", - " female\n", - " NaN\n", + " Braund, Mr. Owen Harris\n", + " male\n", + " 22.0\n", " 1\n", - " 2\n", - " W./C. 6607\n", - " 23.45\n", + " 0\n", + " A/5 21171\n", + " 7.2500\n", " NaN\n", " S\n", " \n", " \n", - " 889\n", - " 890\n", + " 1\n", + " 2\n", " 1\n", " 1\n", - " Behr, Mr. Karl Howell\n", - " male\n", - " 26.0\n", + " Cumings, Mrs. John Bradley (Florence Briggs Th...\n", + " female\n", + " 38.0\n", + " 1\n", " 0\n", - " 0\n", - " 111369\n", - " 30.00\n", - " C148\n", + " PC 17599\n", + " 71.2833\n", + " C85\n", " C\n", " \n", " \n", - " 890\n", - " 891\n", + " 2\n", + " 3\n", + " 1\n", + " 3\n", + " Heikkinen, Miss. Laina\n", + " female\n", + " 26.0\n", + " 0\n", + " 0\n", + " STON/O2. 3101282\n", + " 7.9250\n", + " NaN\n", + " S\n", + " \n", + " \n", + " 3\n", + " 4\n", + " 1\n", + " 1\n", + " Futrelle, Mrs. Jacques Heath (Lily May Peel)\n", + " female\n", + " 35.0\n", + " 1\n", + " 0\n", + " 113803\n", + " 53.1000\n", + " C123\n", + " S\n", + " \n", + " \n", + " 4\n", + " 5\n", " 0\n", " 3\n", - " Dooley, Mr. Patrick\n", + " Allen, Mr. William Henry\n", " male\n", - " 32.0\n", + " 35.0\n", " 0\n", " 0\n", - " 370376\n", - " 7.75\n", + " 373450\n", + " 8.0500\n", " NaN\n", - " Q\n", + " S\n", " \n", " \n", "\n", "" ], "text/plain": [ - " PassengerId Survived Pclass Name \\\n", - "886 887 0 2 Montvila, Rev. Juozas \n", - "887 888 1 1 Graham, Miss. Margaret Edith \n", - "888 889 0 3 Johnston, Miss. Catherine Helen \"Carrie\" \n", - "889 890 1 1 Behr, Mr. Karl Howell \n", - "890 891 0 3 Dooley, Mr. Patrick \n", + " PassengerId Survived Pclass \\\n", + "0 1 0 3 \n", + "1 2 1 1 \n", + "2 3 1 3 \n", + "3 4 1 1 \n", + "4 5 0 3 \n", "\n", - " Sex Age SibSp Parch Ticket Fare Cabin Embarked \n", - "886 male 27.0 0 0 211536 13.00 NaN S \n", - "887 female 19.0 0 0 112053 30.00 B42 S \n", - "888 female NaN 1 2 W./C. 6607 23.45 NaN S \n", - "889 male 26.0 0 0 111369 30.00 C148 C \n", - "890 male 32.0 0 0 370376 7.75 NaN Q " + " Name Sex Age SibSp \\\n", + "0 Braund, Mr. Owen Harris male 22.0 1 \n", + "1 Cumings, Mrs. John Bradley (Florence Briggs Th... female 38.0 1 \n", + "2 Heikkinen, Miss. Laina female 26.0 0 \n", + "3 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 \n", + "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": {}, "output_type": "execute_result" } @@ -206,7 +213,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -340,7 +347,7 @@ "890 male 32.0 0 0 370376 7.75 NaN Q " ] }, - "execution_count": 10, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -358,7 +365,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 30, "metadata": {}, "outputs": [ { @@ -383,7 +390,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 31, "metadata": {}, "outputs": [ { @@ -640,7 +647,7 @@ "[891 rows x 11 columns]" ] }, - "execution_count": 13, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -658,7 +665,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 32, "metadata": {}, "outputs": [ { @@ -679,7 +686,7 @@ "dtype: bool" ] }, - "execution_count": 14, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -697,15 +704,14 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 33, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "80.0\n", - "0.42\n" + "80.0\n" ] } ], @@ -715,7 +721,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -739,7 +745,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -765,15 +771,14 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "male:0.18890814558058924\n", - "female: 0.7420382165605095\n" + "male:0.18890814558058924\n" ] } ], @@ -788,7 +793,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -816,7 +821,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -1055,7 +1060,7 @@ "[891 rows x 12 columns]" ] }, - "execution_count": 19, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -1073,7 +1078,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -1082,7 +1087,7 @@ "" ] }, - "execution_count": 20, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" }, @@ -1110,7 +1115,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -1119,7 +1124,7 @@ "" ] }, - "execution_count": 21, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" },