Skip to content

Commit b503f7f

Browse files
committed
Remove notebook outputs
1 parent b352174 commit b503f7f

23 files changed

Lines changed: 534 additions & 534 deletions
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
"nbformat": 4,
3-
"nbformat_minor": 2,
4-
"metadata": {},
5-
"cells": [
6-
{
7-
"metadata": {},
8-
"source": [
9-
"def introduce_self(name, language):\n",
10-
" # highlight-next-line\n",
11-
" print(f\"\u79c1\u306e\u540d\u524d\u306f\u3001{name}\u3067\u3059\u3002{language}\u9078\u629e\u3067\u3059\u3002\")\n",
12-
"\n",
13-
"\n",
14-
"introduce_self(\"\u6771\u5927\u592a\u90ce\", \"\u4e2d\u56fd\u8a9e\")"
15-
],
16-
"cell_type": "code",
17-
"outputs": [],
18-
"execution_count": null
19-
}
20-
]
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"def introduce_self(name, language):\n",
10+
" # highlight-next-line\n",
11+
" print(f\"私の名前は、{name}です。{language}選択です。\")\n",
12+
"\n",
13+
"\n",
14+
"introduce_self(\"東大太郎\", \"中国語\")"
15+
]
16+
}
17+
],
18+
"metadata": {},
19+
"nbformat": 4,
20+
"nbformat_minor": 2
2121
}
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
"nbformat": 4,
3-
"nbformat_minor": 2,
4-
"metadata": {},
5-
"cells": [
6-
{
7-
"metadata": {},
8-
"source": [
9-
"def introduce_self(name):\n",
10-
" # highlight-next-line\n",
11-
" print(f\"\u79c1\u306e\u540d\u524d\u306f\u3001{name}\u3067\u3059\u3002\")\n",
12-
"\n",
13-
"\n",
14-
"introduce_self(\"\u7530\u4e2d\")"
15-
],
16-
"cell_type": "code",
17-
"outputs": [],
18-
"execution_count": null
19-
}
20-
]
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"def introduce_self(name):\n",
10+
" # highlight-next-line\n",
11+
" print(f\"私の名前は、{name}です。\")\n",
12+
"\n",
13+
"\n",
14+
"introduce_self(\"田中\")"
15+
]
16+
}
17+
],
18+
"metadata": {},
19+
"nbformat": 4,
20+
"nbformat_minor": 2
2121
}
Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
{
2-
"nbformat": 4,
3-
"nbformat_minor": 2,
4-
"metadata": {},
5-
"cells": [
6-
{
7-
"metadata": {},
8-
"source": [
9-
"def gaussian_elimination_revised(a):\n",
10-
" # \u524d\u9032\u6d88\u53bb\n",
11-
" for i in range(len(a)):\n",
12-
" # highlight-start\n",
13-
" # \u90e8\u5206\u30d4\u30dc\u30c3\u30c8\u9078\u629e\n",
14-
" max_index = i\n",
15-
" for j in range(i + 1, len(a)):\n",
16-
" if abs(a[max_index][i]) < abs(a[j][i]):\n",
17-
" max_index = j\n",
18-
" a[i], a[max_index] = a[max_index], a[i]\n",
19-
" # highlight-end\n",
20-
"\n",
21-
" # pivot\u500d\u3067\u884c\u3092\u5272\u308b\n",
22-
" pivot = a[i][i]\n",
23-
" for j in range(i, len(a[i])):\n",
24-
" a[i][j] /= pivot\n",
25-
"\n",
26-
" # i + 1\u884c\u76ee\u4ee5\u964d\u3092\u6383\u304d\u51fa\u3059\n",
27-
" for j in range(i + 1, len(a)):\n",
28-
" factor = a[j][i]\n",
29-
" for k in range(i, len(a[i])):\n",
30-
" a[j][k] -= factor * a[i][k]\n",
31-
"\n",
32-
" # \u5f8c\u9000\u4ee3\u5165\n",
33-
" x = [0 for _ in range(len(a[0]) - 1)]\n",
34-
" for i in reversed(range(len(a))):\n",
35-
" x[i] = a[i][len(a[i]) - 1]\n",
36-
" for j in range(i):\n",
37-
" a[j][len(a[i]) - 1] -= a[j][i] * x[i]\n",
38-
" return x\n",
39-
"\n",
40-
"\n",
41-
"print(gaussian_elimination_revised([[0, -2, 3, 2], [-1, 3, -2, 1], [1, -1, 6, 11]]))"
42-
],
43-
"cell_type": "code",
44-
"outputs": [],
45-
"execution_count": null
46-
}
47-
]
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"def gaussian_elimination_revised(a):\n",
10+
" # 前進消去\n",
11+
" for i in range(len(a)):\n",
12+
" # highlight-start\n",
13+
" # 部分ピボット選択\n",
14+
" max_index = i\n",
15+
" for j in range(i + 1, len(a)):\n",
16+
" if abs(a[max_index][i]) < abs(a[j][i]):\n",
17+
" max_index = j\n",
18+
" a[i], a[max_index] = a[max_index], a[i]\n",
19+
" # highlight-end\n",
20+
"\n",
21+
" # pivot倍で行を割る\n",
22+
" pivot = a[i][i]\n",
23+
" for j in range(i, len(a[i])):\n",
24+
" a[i][j] /= pivot\n",
25+
"\n",
26+
" # i + 1行目以降を掃き出す\n",
27+
" for j in range(i + 1, len(a)):\n",
28+
" factor = a[j][i]\n",
29+
" for k in range(i, len(a[i])):\n",
30+
" a[j][k] -= factor * a[i][k]\n",
31+
"\n",
32+
" # 後退代入\n",
33+
" x = [0 for _ in range(len(a[0]) - 1)]\n",
34+
" for i in reversed(range(len(a))):\n",
35+
" x[i] = a[i][len(a[i]) - 1]\n",
36+
" for j in range(i):\n",
37+
" a[j][len(a[i]) - 1] -= a[j][i] * x[i]\n",
38+
" return x\n",
39+
"\n",
40+
"\n",
41+
"print(gaussian_elimination_revised([[0, -2, 3, 2], [-1, 3, -2, 1], [1, -1, 6, 11]]))"
42+
]
43+
}
44+
],
45+
"metadata": {},
46+
"nbformat": 4,
47+
"nbformat_minor": 2
4848
}

static/image/append.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
2-
"nbformat": 4,
3-
"nbformat_minor": 2,
4-
"metadata": {},
52
"cells": [
63
{
4+
"cell_type": "code",
5+
"execution_count": null,
76
"metadata": {},
7+
"outputs": [],
88
"source": [
99
"a = [1, 2]\n",
1010
"a.append(3)\n",
1111
"print(a)"
12-
],
13-
"cell_type": "code",
14-
"outputs": [],
15-
"execution_count": null
12+
]
1613
}
17-
]
14+
],
15+
"metadata": {},
16+
"nbformat": 4,
17+
"nbformat_minor": 2
1818
}
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
2-
"nbformat": 4,
3-
"nbformat_minor": 2,
4-
"metadata": {},
5-
"cells": [
6-
{
7-
"metadata": {},
8-
"source": [
9-
"def count_neighbors(board, i, j):\n",
10-
" cnt = 0\n",
11-
" for k in range(i - 1, i + 2):\n",
12-
" for l in range(j - 1, j + 2):\n",
13-
" # highlight-next-line\n",
14-
" if 0 <= k < len(board) and 0 <= l < len(board[k]):\n",
15-
" cnt += board[k][l]\n",
16-
" return cnt - board[i][j]\n",
17-
"\n",
18-
"\n",
19-
"board = [[1, 1, 0], [1, 0, 0], [0, 0, 0]]\n",
20-
"print(count_neighbors(board, 0, 0))"
21-
],
22-
"cell_type": "code",
23-
"outputs": [],
24-
"execution_count": null
25-
}
26-
]
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"def count_neighbors(board, i, j):\n",
10+
" cnt = 0\n",
11+
" for k in range(i - 1, i + 2):\n",
12+
" for l in range(j - 1, j + 2):\n",
13+
" # highlight-next-line\n",
14+
" if 0 <= k < len(board) and 0 <= l < len(board[k]):\n",
15+
" cnt += board[k][l]\n",
16+
" return cnt - board[i][j]\n",
17+
"\n",
18+
"\n",
19+
"board = [[1, 1, 0], [1, 0, 0], [0, 0, 0]]\n",
20+
"print(count_neighbors(board, 0, 0))"
21+
]
22+
}
23+
],
24+
"metadata": {},
25+
"nbformat": 4,
26+
"nbformat_minor": 2
2727
}

static/life-game/is_alive.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"nbformat": 4,
3-
"nbformat_minor": 2,
4-
"metadata": {},
52
"cells": [
63
{
4+
"cell_type": "code",
5+
"execution_count": null,
76
"metadata": {},
7+
"outputs": [],
88
"source": [
99
"def count_neighbors(board, i, j):\n",
1010
" cnt = 0\n",
@@ -37,10 +37,10 @@
3737
"\n",
3838
"board = [[1, 1, 0], [1, 0, 0], [0, 0, 0]]\n",
3939
"print(is_alive(board, 0, 0))"
40-
],
41-
"cell_type": "code",
42-
"outputs": [],
43-
"execution_count": null
40+
]
4441
}
45-
]
42+
],
43+
"metadata": {},
44+
"nbformat": 4,
45+
"nbformat_minor": 2
4646
}

static/life-game/life_game.ipynb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
2-
"nbformat": 4,
3-
"nbformat_minor": 2,
4-
"metadata": {},
52
"cells": [
63
{
4+
"cell_type": "code",
5+
"execution_count": null,
76
"metadata": {},
7+
"outputs": [],
88
"source": [
99
"!pip install ita"
10-
],
11-
"cell_type": "code",
12-
"outputs": [],
13-
"execution_count": null
10+
]
1411
},
1512
{
13+
"cell_type": "code",
14+
"execution_count": null,
1615
"metadata": {},
16+
"outputs": [],
1717
"source": [
1818
"import ita\n",
1919
"\n",
2020
"%matplotlib inline"
21-
],
22-
"cell_type": "code",
23-
"outputs": [],
24-
"execution_count": null
21+
]
2522
},
2623
{
24+
"cell_type": "code",
25+
"execution_count": null,
2726
"metadata": {},
27+
"outputs": [],
2828
"source": [
2929
"def count_neighbors(board, i, j):\n",
3030
" cnt = 0\n",
@@ -82,10 +82,10 @@
8282
"n = 20\n",
8383
"images = life_game(data, n)\n",
8484
"ita.plot.animation_show(images)"
85-
],
86-
"cell_type": "code",
87-
"outputs": [],
88-
"execution_count": null
85+
]
8986
}
90-
]
87+
],
88+
"metadata": {},
89+
"nbformat": 4,
90+
"nbformat_minor": 2
9191
}

0 commit comments

Comments
 (0)