Skip to content

Commit

Permalink
Merge pull request #307 from kangwonlee/lecture-idea
Browse files Browse the repository at this point in the history
Lecture idea
  • Loading branch information
kangwonlee authored Sep 30, 2023
2 parents 7ffbd49 + d60ce4d commit 8d1f1c0
Show file tree
Hide file tree
Showing 62 changed files with 289 additions and 81 deletions.
2 changes: 1 addition & 1 deletion 00_introduction/00_introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/00_introduction/00_introduction.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/00_introduction/00_introduction.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 00_introduction/10_floating_point.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/00_introduction/10_floating_point.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/00_introduction/10_floating_point.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
177 changes: 166 additions & 11 deletions 00_introduction/20_python_review.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/00_introduction/20_python_review.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/00_introduction/20_python_review.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand All @@ -26,6 +26,15 @@
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* `print()` 함수를 호출하여 화면에 표시\n",
"* `(` 와 `)`의 사이는 함수의 매개변수\n",
"* 수학의 함수 $f(x)$ 와 비슷\n"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -75,6 +84,60 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(0.3 + 0.6 - 0.9)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(0.01 + 0.02 - 0.03)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print((0.1 + 0.2) == 0.3)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import math\n",
"print(\n",
" math.isclose(\n",
" 0.1 + 0.2,\n",
" 0.3,\n",
" )\n",
")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"1 + 2, 1.0 + 2\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -223,7 +286,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Numeric literals with `_`<br>숫자 상수 표시에 `_` 사용\n",
"Numeric literals with `_` for readability<br>가독성을 위해 숫자 상수 표시에 `_` 사용\n",
"\n"
]
},
Expand Down Expand Up @@ -255,6 +318,15 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"_22\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -534,7 +606,30 @@
"source": [
"a = 2 + 3j\n",
"b = 3\n",
"a * b\n",
"c = a * b\n",
"c\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# c의 실수부\n",
"c.real\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# c의 허수부\n",
"c.imag\n",
"\n"
]
},
Expand Down Expand Up @@ -587,6 +682,16 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\"%d + %d = %d\" % (a, b, a+b)\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -634,6 +739,15 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!hexdump -C hello.c\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -671,6 +785,15 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!hexdump -C a.out\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -801,12 +924,14 @@
"aa = \"real 1.0\"\n",
"bb = 3\n",
"cc = aa * bb\n",
"# 아래는 Try Except Block\n",
"# \"예외 처리\"를 위함\n",
"try:\n",
" # Error!\n",
" print(\"%f * %f = %f\" % (aa, bb, cc))\n",
"except TypeError as e:\n",
" print(e)\n",
"\n"
"# Try Exception Block 끝\n"
]
},
{
Expand Down Expand Up @@ -1010,6 +1135,15 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"twice('zzz')\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -1787,7 +1921,7 @@
"metadata": {},
"outputs": [],
"source": [
"'b' in z_list\n",
"\"b\" in z_list\n",
"\n"
]
},
Expand Down Expand Up @@ -2012,7 +2146,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### `.get()`\n",
"`in`\n",
"\n"
]
},
Expand Down Expand Up @@ -2046,6 +2180,24 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"1 in a_dict\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### `.get()`\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -3147,12 +3299,15 @@
],
"metadata": {
"colab": {
"include_colab_link": true,
"name": "20_python_review.ipynb",
"provenance": []
"provenance": [
{
"file_id": "https://github.com/kangwonlee/nmisp/blob/main/00_introduction/20_python_review.ipynb",
"timestamp": 1694501689775
}
]
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -3166,7 +3321,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.10.10"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion 00_introduction/30_python_review_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/00_introduction/30_python_review_2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/00_introduction/30_python_review_2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 00_introduction/40_how_to_draw_a_circle.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/00_introduction/40_how_to_draw_a_circle.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/00_introduction/40_how_to_draw_a_circle.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 00_introduction/50_pandas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/00_introduction/50_pandas.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/00_introduction/50_pandas.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 10_root_finding/10_sequential.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/10_root_finding/10_sequential.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/10_root_finding/10_sequential.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 10_root_finding/20_bisection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/10_root_finding/20_bisection.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/10_root_finding/20_bisection.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 10_root_finding/30_newton_raphson.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/10_root_finding/30_newton_raphson.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/10_root_finding/30_newton_raphson.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 10_root_finding/40_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/10_root_finding/40_examples.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/10_root_finding/40_examples.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 10_root_finding/42_examples_beams.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/10_root_finding/42_examples_beams.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/10_root_finding/42_examples_beams.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 10_root_finding/45_newton_raphson_complex.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/main/10_root_finding/45_newton_raphson_complex.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
"<a href=\"https://colab.research.google.com/github/kangwonlee/nmisp/blob/lecture-idea/10_root_finding/45_newton_raphson_complex.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n"
]
},
{
Expand Down
Loading

0 comments on commit 8d1f1c0

Please sign in to comment.