Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc26a7b0

Browse files
committed
Clear Jupyter Notebook Cells
1 parent169c73e commitc26a7b0

15 files changed

+101
-281
lines changed

‎jupyter_notebooks/01_Python_Basics.ipynb‎

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,9 @@
2424
},
2525
{
2626
"cell_type":"code",
27-
"execution_count":1,
28-
"metadata": {},
29-
"outputs": [
30-
{
31-
"name":"stdout",
32-
"output_type":"stream",
33-
"text": [
34-
"The Zen of Python, by Tim Peters\n",
35-
"\n",
36-
"Beautiful is better than ugly.\n",
37-
"Explicit is better than implicit.\n",
38-
"Simple is better than complex.\n",
39-
"Complex is better than complicated.\n",
40-
"Flat is better than nested.\n",
41-
"Sparse is better than dense.\n",
42-
"Readability counts.\n",
43-
"Special cases aren't special enough to break the rules.\n",
44-
"Although practicality beats purity.\n",
45-
"Errors should never pass silently.\n",
46-
"Unless explicitly silenced.\n",
47-
"In the face of ambiguity, refuse the temptation to guess.\n",
48-
"There should be one-- and preferably only one --obvious way to do it.\n",
49-
"Although that way may not be obvious at first unless you're Dutch.\n",
50-
"Now is better than never.\n",
51-
"Although never is often better than *right* now.\n",
52-
"If the implementation is hard to explain, it's a bad idea.\n",
53-
"If the implementation is easy to explain, it may be a good idea.\n",
54-
"Namespaces are one honking great idea -- let's do more of those!\n"
55-
]
56-
}
57-
],
27+
"execution_count":null,
28+
"metadata": {},
29+
"outputs": [],
5830
"source": [
5931
"import this"
6032
]

‎jupyter_notebooks/02_Flow_Control.ipynb‎

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,9 @@
333333
},
334334
{
335335
"cell_type":"code",
336-
"execution_count":1,
337-
"metadata": {},
338-
"outputs": [
339-
{
340-
"name":"stdout",
341-
"output_type":"stream",
342-
"text": [
343-
"You are not Alice, kiddo.\n"
344-
]
345-
}
346-
],
336+
"execution_count":null,
337+
"metadata": {},
338+
"outputs": [],
347339
"source": [
348340
"name = 'Bob'\n",
349341
"age = 5\n",
@@ -356,17 +348,9 @@
356348
},
357349
{
358350
"cell_type":"code",
359-
"execution_count":2,
351+
"execution_count":null,
360352
"metadata": {},
361-
"outputs": [
362-
{
363-
"name":"stdout",
364-
"output_type":"stream",
365-
"text": [
366-
"You are neither Alice nor a little kid.\n"
367-
]
368-
}
369-
],
353+
"outputs": [],
370354
"source": [
371355
"name = 'Bob'\n",
372356
"age = 30\n",

‎jupyter_notebooks/03_Functions.ipynb‎

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"cell_type":"code",
23-
"execution_count":1,
23+
"execution_count":null,
2424
"metadata": {},
2525
"outputs": [],
2626
"source": [
@@ -43,17 +43,9 @@
4343
},
4444
{
4545
"cell_type":"code",
46-
"execution_count":2,
46+
"execution_count":null,
4747
"metadata": {},
48-
"outputs": [
49-
{
50-
"name":"stdout",
51-
"output_type":"stream",
52-
"text": [
53-
"Yes\n"
54-
]
55-
}
56-
],
48+
"outputs": [],
5749
"source": [
5850
"import random\n",
5951
"def getAnswer(answerNumber):\n",
@@ -90,27 +82,9 @@
9082
},
9183
{
9284
"cell_type":"code",
93-
"execution_count":4,
85+
"execution_count":null,
9486
"metadata": {},
95-
"outputs": [
96-
{
97-
"name":"stdout",
98-
"output_type":"stream",
99-
"text": [
100-
"Hello!\n"
101-
]
102-
},
103-
{
104-
"data": {
105-
"text/plain": [
106-
"True"
107-
]
108-
},
109-
"execution_count":4,
110-
"metadata": {},
111-
"output_type":"execute_result"
112-
}
113-
],
87+
"outputs": [],
11488
"source": [
11589
"spam = print('Hello!')\n",
11690
"spam is None"

‎jupyter_notebooks/04_Exception_Handling.ipynb‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,25 @@
6767
]
6868
}
6969
],
70-
"metadata": {},
70+
"metadata": {
71+
"kernelspec": {
72+
"display_name":"Python 3",
73+
"language":"python",
74+
"name":"python3"
75+
},
76+
"language_info": {
77+
"codemirror_mode": {
78+
"name":"ipython",
79+
"version":3
80+
},
81+
"file_extension":".py",
82+
"mimetype":"text/x-python",
83+
"name":"python",
84+
"nbconvert_exporter":"python",
85+
"pygments_lexer":"ipython3",
86+
"version":"3.7.0"
87+
}
88+
},
7189
"nbformat":4,
7290
"nbformat_minor":2
7391
}

‎jupyter_notebooks/05_Lists_and_Tuples.ipynb‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,25 @@
703703
]
704704
}
705705
],
706-
"metadata": {},
706+
"metadata": {
707+
"kernelspec": {
708+
"display_name":"Python 3",
709+
"language":"python",
710+
"name":"python3"
711+
},
712+
"language_info": {
713+
"codemirror_mode": {
714+
"name":"ipython",
715+
"version":3
716+
},
717+
"file_extension":".py",
718+
"mimetype":"text/x-python",
719+
"name":"python",
720+
"nbconvert_exporter":"python",
721+
"pygments_lexer":"ipython3",
722+
"version":"3.7.0"
723+
}
724+
},
707725
"nbformat":4,
708726
"nbformat_minor":2
709727
}

‎jupyter_notebooks/06_Dictionaries.ipynb‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -281,20 +281,9 @@
281281
},
282282
{
283283
"cell_type":"code",
284-
"execution_count":1,
284+
"execution_count":null,
285285
"metadata": {},
286-
"outputs": [
287-
{
288-
"data": {
289-
"text/plain": [
290-
"{'a': 1, 'b': 3, 'c': 4}"
291-
]
292-
},
293-
"execution_count":1,
294-
"metadata": {},
295-
"output_type":"execute_result"
296-
}
297-
],
286+
"outputs": [],
298287
"source": [
299288
"# in Python 3.5+:\n",
300289
"x = {'a': 1, 'b': 2}\n",

‎jupyter_notebooks/07_Sets.ipynb‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -255,20 +255,9 @@
255255
},
256256
{
257257
"cell_type":"code",
258-
"execution_count":1,
258+
"execution_count":null,
259259
"metadata": {},
260-
"outputs": [
261-
{
262-
"data": {
263-
"text/plain": [
264-
"{1, 4}"
265-
]
266-
},
267-
"execution_count":1,
268-
"metadata": {},
269-
"output_type":"execute_result"
270-
}
271-
],
260+
"outputs": [],
272261
"source": [
273262
"s1 = {1, 2, 3}\n",
274263
"s2 = {2, 3, 4}\n",

‎jupyter_notebooks/08_itertools_Module.ipynb‎

Lines changed: 9 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
{
3232
"cell_type":"code",
33-
"execution_count":1,
33+
"execution_count":null,
3434
"metadata": {},
3535
"outputs": [],
3636
"source": [
@@ -65,21 +65,9 @@
6565
},
6666
{
6767
"cell_type":"code",
68-
"execution_count":2,
68+
"execution_count":null,
6969
"metadata": {},
70-
"outputs": [
71-
{
72-
"name":"stdout",
73-
"output_type":"stream",
74-
"text": [
75-
"1\n",
76-
"2\n",
77-
"6\n",
78-
"24\n",
79-
"120\n"
80-
]
81-
}
82-
],
70+
"outputs": [],
8371
"source": [
8472
"data = [1, 2, 3, 4, 5]\n",
8573
"result = itertools.accumulate(data, operator.mul)\n",
@@ -123,20 +111,9 @@
123111
},
124112
{
125113
"cell_type":"code",
126-
"execution_count":3,
114+
"execution_count":null,
127115
"metadata": {},
128-
"outputs": [
129-
{
130-
"data": {
131-
"text/plain": [
132-
"120"
133-
]
134-
},
135-
"execution_count":3,
136-
"metadata": {},
137-
"output_type":"execute_result"
138-
}
139-
],
116+
"outputs": [],
140117
"source": [
141118
"operator.mul(24, 5)"
142119
]
@@ -210,19 +187,9 @@
210187
},
211188
{
212189
"cell_type":"code",
213-
"execution_count":4,
190+
"execution_count":null,
214191
"metadata": {},
215-
"outputs": [
216-
{
217-
"name":"stdout",
218-
"output_type":"stream",
219-
"text": [
220-
"('circle', 'triangle')\n",
221-
"('circle', 'square')\n",
222-
"('triangle', 'square')\n"
223-
]
224-
}
225-
],
192+
"outputs": [],
226193
"source": [
227194
"shapes = ['circle', 'triangle', 'square',]\n",
228195
"result = itertools.combinations(shapes, 2)\n",
@@ -713,19 +680,9 @@
713680
},
714681
{
715682
"cell_type":"code",
716-
"execution_count":5,
683+
"execution_count":null,
717684
"metadata": {},
718-
"outputs": [
719-
{
720-
"name":"stdout",
721-
"output_type":"stream",
722-
"text": [
723-
"12\n",
724-
"32\n",
725-
"21\n"
726-
]
727-
}
728-
],
685+
"outputs": [],
729686
"source": [
730687
"data = [(2, 6), (8, 4), (7, 3)]\n",
731688
"result = itertools.starmap(operator.mul, data)\n",

‎jupyter_notebooks/09_Comprehensions.ipynb‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,9 @@
2222
},
2323
{
2424
"cell_type":"code",
25-
"execution_count":1,
25+
"execution_count":null,
2626
"metadata": {},
27-
"outputs": [
28-
{
29-
"data": {
30-
"text/plain": [
31-
"[0, 2, 4, 6, 8, 10]"
32-
]
33-
},
34-
"execution_count":1,
35-
"metadata": {},
36-
"output_type":"execute_result"
37-
}
38-
],
27+
"outputs": [],
3928
"source": [
4029
"a = [1, 3, 5, 7, 9, 11]\n",
4130
"[i - 1 for i in a]"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp