+++ 20200502/.ipynb_checkpoints/df-checkpoint.ipynb
... | ... | @@ -0,0 +1,836 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 7, | |
6 | + "id": "d318019a", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import pandas as pd" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 12, | |
16 | + "id": "78fed803", | |
17 | + "metadata": {}, | |
18 | + "outputs": [], | |
19 | + "source": [ | |
20 | + "df = pd.read_csv('./sample2.csv', encoding='euc-kr')" | |
21 | + ] | |
22 | + }, | |
23 | + { | |
24 | + "cell_type": "code", | |
25 | + "execution_count": 13, | |
26 | + "id": "e1a03a23", | |
27 | + "metadata": {}, | |
28 | + "outputs": [ | |
29 | + { | |
30 | + "data": { | |
31 | + "text/html": [ | |
32 | + "<div>\n", | |
33 | + "<style scoped>\n", | |
34 | + " .dataframe tbody tr th:only-of-type {\n", | |
35 | + " vertical-align: middle;\n", | |
36 | + " }\n", | |
37 | + "\n", | |
38 | + " .dataframe tbody tr th {\n", | |
39 | + " vertical-align: top;\n", | |
40 | + " }\n", | |
41 | + "\n", | |
42 | + " .dataframe thead th {\n", | |
43 | + " text-align: right;\n", | |
44 | + " }\n", | |
45 | + "</style>\n", | |
46 | + "<table border=\"1\" class=\"dataframe\">\n", | |
47 | + " <thead>\n", | |
48 | + " <tr style=\"text-align: right;\">\n", | |
49 | + " <th></th>\n", | |
50 | + " <th>이름</th>\n", | |
51 | + " <th>나이</th>\n", | |
52 | + " <th>성별</th>\n", | |
53 | + " <th>키</th>\n", | |
54 | + " <th>체중</th>\n", | |
55 | + " </tr>\n", | |
56 | + " </thead>\n", | |
57 | + " <tbody>\n", | |
58 | + " <tr>\n", | |
59 | + " <th>0</th>\n", | |
60 | + " <td>홍길동</td>\n", | |
61 | + " <td>25</td>\n", | |
62 | + " <td>남</td>\n", | |
63 | + " <td>185</td>\n", | |
64 | + " <td>89</td>\n", | |
65 | + " </tr>\n", | |
66 | + " <tr>\n", | |
67 | + " <th>1</th>\n", | |
68 | + " <td>이순신</td>\n", | |
69 | + " <td>19</td>\n", | |
70 | + " <td>여</td>\n", | |
71 | + " <td>163</td>\n", | |
72 | + " <td>53</td>\n", | |
73 | + " </tr>\n", | |
74 | + " </tbody>\n", | |
75 | + "</table>\n", | |
76 | + "</div>" | |
77 | + ], | |
78 | + "text/plain": [ | |
79 | + " 이름 나이 성별 키 체중\n", | |
80 | + "0 홍길동 25 남 185 89\n", | |
81 | + "1 이순신 19 여 163 53" | |
82 | + ] | |
83 | + }, | |
84 | + "execution_count": 13, | |
85 | + "metadata": {}, | |
86 | + "output_type": "execute_result" | |
87 | + } | |
88 | + ], | |
89 | + "source": [ | |
90 | + "df" | |
91 | + ] | |
92 | + }, | |
93 | + { | |
94 | + "cell_type": "code", | |
95 | + "execution_count": 16, | |
96 | + "id": "8276cfba", | |
97 | + "metadata": {}, | |
98 | + "outputs": [], | |
99 | + "source": [ | |
100 | + "df = df.set_index('이름')" | |
101 | + ] | |
102 | + }, | |
103 | + { | |
104 | + "cell_type": "code", | |
105 | + "execution_count": 17, | |
106 | + "id": "945a1142", | |
107 | + "metadata": {}, | |
108 | + "outputs": [ | |
109 | + { | |
110 | + "data": { | |
111 | + "text/html": [ | |
112 | + "<div>\n", | |
113 | + "<style scoped>\n", | |
114 | + " .dataframe tbody tr th:only-of-type {\n", | |
115 | + " vertical-align: middle;\n", | |
116 | + " }\n", | |
117 | + "\n", | |
118 | + " .dataframe tbody tr th {\n", | |
119 | + " vertical-align: top;\n", | |
120 | + " }\n", | |
121 | + "\n", | |
122 | + " .dataframe thead th {\n", | |
123 | + " text-align: right;\n", | |
124 | + " }\n", | |
125 | + "</style>\n", | |
126 | + "<table border=\"1\" class=\"dataframe\">\n", | |
127 | + " <thead>\n", | |
128 | + " <tr style=\"text-align: right;\">\n", | |
129 | + " <th></th>\n", | |
130 | + " <th>나이</th>\n", | |
131 | + " <th>성별</th>\n", | |
132 | + " <th>키</th>\n", | |
133 | + " <th>체중</th>\n", | |
134 | + " </tr>\n", | |
135 | + " <tr>\n", | |
136 | + " <th>이름</th>\n", | |
137 | + " <th></th>\n", | |
138 | + " <th></th>\n", | |
139 | + " <th></th>\n", | |
140 | + " <th></th>\n", | |
141 | + " </tr>\n", | |
142 | + " </thead>\n", | |
143 | + " <tbody>\n", | |
144 | + " <tr>\n", | |
145 | + " <th>홍길동</th>\n", | |
146 | + " <td>25</td>\n", | |
147 | + " <td>남</td>\n", | |
148 | + " <td>185</td>\n", | |
149 | + " <td>89</td>\n", | |
150 | + " </tr>\n", | |
151 | + " <tr>\n", | |
152 | + " <th>이순신</th>\n", | |
153 | + " <td>19</td>\n", | |
154 | + " <td>여</td>\n", | |
155 | + " <td>163</td>\n", | |
156 | + " <td>53</td>\n", | |
157 | + " </tr>\n", | |
158 | + " </tbody>\n", | |
159 | + "</table>\n", | |
160 | + "</div>" | |
161 | + ], | |
162 | + "text/plain": [ | |
163 | + " 나이 성별 키 체중\n", | |
164 | + "이름 \n", | |
165 | + "홍길동 25 남 185 89\n", | |
166 | + "이순신 19 여 163 53" | |
167 | + ] | |
168 | + }, | |
169 | + "execution_count": 17, | |
170 | + "metadata": {}, | |
171 | + "output_type": "execute_result" | |
172 | + } | |
173 | + ], | |
174 | + "source": [ | |
175 | + "df" | |
176 | + ] | |
177 | + }, | |
178 | + { | |
179 | + "cell_type": "code", | |
180 | + "execution_count": 25, | |
181 | + "id": "111a1c5f", | |
182 | + "metadata": {}, | |
183 | + "outputs": [ | |
184 | + { | |
185 | + "data": { | |
186 | + "text/html": [ | |
187 | + "<div>\n", | |
188 | + "<style scoped>\n", | |
189 | + " .dataframe tbody tr th:only-of-type {\n", | |
190 | + " vertical-align: middle;\n", | |
191 | + " }\n", | |
192 | + "\n", | |
193 | + " .dataframe tbody tr th {\n", | |
194 | + " vertical-align: top;\n", | |
195 | + " }\n", | |
196 | + "\n", | |
197 | + " .dataframe thead th {\n", | |
198 | + " text-align: right;\n", | |
199 | + " }\n", | |
200 | + "</style>\n", | |
201 | + "<table border=\"1\" class=\"dataframe\">\n", | |
202 | + " <thead>\n", | |
203 | + " <tr style=\"text-align: right;\">\n", | |
204 | + " <th></th>\n", | |
205 | + " <th>나이</th>\n", | |
206 | + " <th>성별</th>\n", | |
207 | + " <th>키</th>\n", | |
208 | + " <th>체중</th>\n", | |
209 | + " </tr>\n", | |
210 | + " <tr>\n", | |
211 | + " <th>이름</th>\n", | |
212 | + " <th></th>\n", | |
213 | + " <th></th>\n", | |
214 | + " <th></th>\n", | |
215 | + " <th></th>\n", | |
216 | + " </tr>\n", | |
217 | + " </thead>\n", | |
218 | + " <tbody>\n", | |
219 | + " <tr>\n", | |
220 | + " <th>홍길동</th>\n", | |
221 | + " <td>25</td>\n", | |
222 | + " <td>남</td>\n", | |
223 | + " <td>185</td>\n", | |
224 | + " <td>89</td>\n", | |
225 | + " </tr>\n", | |
226 | + " <tr>\n", | |
227 | + " <th>이순신</th>\n", | |
228 | + " <td>19</td>\n", | |
229 | + " <td>여</td>\n", | |
230 | + " <td>163</td>\n", | |
231 | + " <td>53</td>\n", | |
232 | + " </tr>\n", | |
233 | + " </tbody>\n", | |
234 | + "</table>\n", | |
235 | + "</div>" | |
236 | + ], | |
237 | + "text/plain": [ | |
238 | + " 나이 성별 키 체중\n", | |
239 | + "이름 \n", | |
240 | + "홍길동 25 남 185 89\n", | |
241 | + "이순신 19 여 163 53" | |
242 | + ] | |
243 | + }, | |
244 | + "execution_count": 25, | |
245 | + "metadata": {}, | |
246 | + "output_type": "execute_result" | |
247 | + } | |
248 | + ], | |
249 | + "source": [ | |
250 | + "df.loc[['홍길동', '이순신']]" | |
251 | + ] | |
252 | + }, | |
253 | + { | |
254 | + "cell_type": "code", | |
255 | + "execution_count": 27, | |
256 | + "id": "59442de0", | |
257 | + "metadata": {}, | |
258 | + "outputs": [ | |
259 | + { | |
260 | + "data": { | |
261 | + "text/html": [ | |
262 | + "<div>\n", | |
263 | + "<style scoped>\n", | |
264 | + " .dataframe tbody tr th:only-of-type {\n", | |
265 | + " vertical-align: middle;\n", | |
266 | + " }\n", | |
267 | + "\n", | |
268 | + " .dataframe tbody tr th {\n", | |
269 | + " vertical-align: top;\n", | |
270 | + " }\n", | |
271 | + "\n", | |
272 | + " .dataframe thead th {\n", | |
273 | + " text-align: right;\n", | |
274 | + " }\n", | |
275 | + "</style>\n", | |
276 | + "<table border=\"1\" class=\"dataframe\">\n", | |
277 | + " <thead>\n", | |
278 | + " <tr style=\"text-align: right;\">\n", | |
279 | + " <th></th>\n", | |
280 | + " <th>나이</th>\n", | |
281 | + " </tr>\n", | |
282 | + " <tr>\n", | |
283 | + " <th>이름</th>\n", | |
284 | + " <th></th>\n", | |
285 | + " </tr>\n", | |
286 | + " </thead>\n", | |
287 | + " <tbody>\n", | |
288 | + " <tr>\n", | |
289 | + " <th>홍길동</th>\n", | |
290 | + " <td>25</td>\n", | |
291 | + " </tr>\n", | |
292 | + " <tr>\n", | |
293 | + " <th>이순신</th>\n", | |
294 | + " <td>19</td>\n", | |
295 | + " </tr>\n", | |
296 | + " </tbody>\n", | |
297 | + "</table>\n", | |
298 | + "</div>" | |
299 | + ], | |
300 | + "text/plain": [ | |
301 | + " 나이\n", | |
302 | + "이름 \n", | |
303 | + "홍길동 25\n", | |
304 | + "이순신 19" | |
305 | + ] | |
306 | + }, | |
307 | + "execution_count": 27, | |
308 | + "metadata": {}, | |
309 | + "output_type": "execute_result" | |
310 | + } | |
311 | + ], | |
312 | + "source": [ | |
313 | + "df[['나이']]" | |
314 | + ] | |
315 | + }, | |
316 | + { | |
317 | + "cell_type": "code", | |
318 | + "execution_count": 31, | |
319 | + "id": "9adeed0c", | |
320 | + "metadata": {}, | |
321 | + "outputs": [ | |
322 | + { | |
323 | + "data": { | |
324 | + "text/html": [ | |
325 | + "<div>\n", | |
326 | + "<style scoped>\n", | |
327 | + " .dataframe tbody tr th:only-of-type {\n", | |
328 | + " vertical-align: middle;\n", | |
329 | + " }\n", | |
330 | + "\n", | |
331 | + " .dataframe tbody tr th {\n", | |
332 | + " vertical-align: top;\n", | |
333 | + " }\n", | |
334 | + "\n", | |
335 | + " .dataframe thead th {\n", | |
336 | + " text-align: right;\n", | |
337 | + " }\n", | |
338 | + "</style>\n", | |
339 | + "<table border=\"1\" class=\"dataframe\">\n", | |
340 | + " <thead>\n", | |
341 | + " <tr style=\"text-align: right;\">\n", | |
342 | + " <th></th>\n", | |
343 | + " <th>성별</th>\n", | |
344 | + " <th>키</th>\n", | |
345 | + " <th>체중</th>\n", | |
346 | + " </tr>\n", | |
347 | + " <tr>\n", | |
348 | + " <th>이름</th>\n", | |
349 | + " <th></th>\n", | |
350 | + " <th></th>\n", | |
351 | + " <th></th>\n", | |
352 | + " </tr>\n", | |
353 | + " </thead>\n", | |
354 | + " <tbody>\n", | |
355 | + " <tr>\n", | |
356 | + " <th>홍길동</th>\n", | |
357 | + " <td>남</td>\n", | |
358 | + " <td>185</td>\n", | |
359 | + " <td>89</td>\n", | |
360 | + " </tr>\n", | |
361 | + " <tr>\n", | |
362 | + " <th>이순신</th>\n", | |
363 | + " <td>여</td>\n", | |
364 | + " <td>163</td>\n", | |
365 | + " <td>53</td>\n", | |
366 | + " </tr>\n", | |
367 | + " </tbody>\n", | |
368 | + "</table>\n", | |
369 | + "</div>" | |
370 | + ], | |
371 | + "text/plain": [ | |
372 | + " 성별 키 체중\n", | |
373 | + "이름 \n", | |
374 | + "홍길동 남 185 89\n", | |
375 | + "이순신 여 163 53" | |
376 | + ] | |
377 | + }, | |
378 | + "execution_count": 31, | |
379 | + "metadata": {}, | |
380 | + "output_type": "execute_result" | |
381 | + } | |
382 | + ], | |
383 | + "source": [ | |
384 | + "df[['성별', '키', '체중']]" | |
385 | + ] | |
386 | + }, | |
387 | + { | |
388 | + "cell_type": "code", | |
389 | + "execution_count": 32, | |
390 | + "id": "3e72a447", | |
391 | + "metadata": {}, | |
392 | + "outputs": [], | |
393 | + "source": [ | |
394 | + "df['DMI'] = 0" | |
395 | + ] | |
396 | + }, | |
397 | + { | |
398 | + "cell_type": "code", | |
399 | + "execution_count": 44, | |
400 | + "id": "e9b958e8", | |
401 | + "metadata": {}, | |
402 | + "outputs": [ | |
403 | + { | |
404 | + "data": { | |
405 | + "text/html": [ | |
406 | + "<div>\n", | |
407 | + "<style scoped>\n", | |
408 | + " .dataframe tbody tr th:only-of-type {\n", | |
409 | + " vertical-align: middle;\n", | |
410 | + " }\n", | |
411 | + "\n", | |
412 | + " .dataframe tbody tr th {\n", | |
413 | + " vertical-align: top;\n", | |
414 | + " }\n", | |
415 | + "\n", | |
416 | + " .dataframe thead th {\n", | |
417 | + " text-align: right;\n", | |
418 | + " }\n", | |
419 | + "</style>\n", | |
420 | + "<table border=\"1\" class=\"dataframe\">\n", | |
421 | + " <thead>\n", | |
422 | + " <tr style=\"text-align: right;\">\n", | |
423 | + " <th></th>\n", | |
424 | + " <th>나이</th>\n", | |
425 | + " <th>성별</th>\n", | |
426 | + " <th>키</th>\n", | |
427 | + " <th>체중</th>\n", | |
428 | + " <th>DMI</th>\n", | |
429 | + " </tr>\n", | |
430 | + " <tr>\n", | |
431 | + " <th>이름</th>\n", | |
432 | + " <th></th>\n", | |
433 | + " <th></th>\n", | |
434 | + " <th></th>\n", | |
435 | + " <th></th>\n", | |
436 | + " <th></th>\n", | |
437 | + " </tr>\n", | |
438 | + " </thead>\n", | |
439 | + " <tbody>\n", | |
440 | + " <tr>\n", | |
441 | + " <th>홍길동</th>\n", | |
442 | + " <td>25</td>\n", | |
443 | + " <td>남</td>\n", | |
444 | + " <td>185</td>\n", | |
445 | + " <td>89</td>\n", | |
446 | + " <td>0</td>\n", | |
447 | + " </tr>\n", | |
448 | + " <tr>\n", | |
449 | + " <th>이순신</th>\n", | |
450 | + " <td>19</td>\n", | |
451 | + " <td>여</td>\n", | |
452 | + " <td>163</td>\n", | |
453 | + " <td>53</td>\n", | |
454 | + " <td>0</td>\n", | |
455 | + " </tr>\n", | |
456 | + " </tbody>\n", | |
457 | + "</table>\n", | |
458 | + "</div>" | |
459 | + ], | |
460 | + "text/plain": [ | |
461 | + " 나이 성별 키 체중 DMI\n", | |
462 | + "이름 \n", | |
463 | + "홍길동 25 남 185 89 0\n", | |
464 | + "이순신 19 여 163 53 0" | |
465 | + ] | |
466 | + }, | |
467 | + "execution_count": 44, | |
468 | + "metadata": {}, | |
469 | + "output_type": "execute_result" | |
470 | + } | |
471 | + ], | |
472 | + "source": [ | |
473 | + "df" | |
474 | + ] | |
475 | + }, | |
476 | + { | |
477 | + "cell_type": "code", | |
478 | + "execution_count": 45, | |
479 | + "id": "c435db05", | |
480 | + "metadata": {}, | |
481 | + "outputs": [], | |
482 | + "source": [ | |
483 | + "df.loc['유관순'] = 0" | |
484 | + ] | |
485 | + }, | |
486 | + { | |
487 | + "cell_type": "code", | |
488 | + "execution_count": 46, | |
489 | + "id": "5c13154e", | |
490 | + "metadata": {}, | |
491 | + "outputs": [ | |
492 | + { | |
493 | + "data": { | |
494 | + "text/html": [ | |
495 | + "<div>\n", | |
496 | + "<style scoped>\n", | |
497 | + " .dataframe tbody tr th:only-of-type {\n", | |
498 | + " vertical-align: middle;\n", | |
499 | + " }\n", | |
500 | + "\n", | |
501 | + " .dataframe tbody tr th {\n", | |
502 | + " vertical-align: top;\n", | |
503 | + " }\n", | |
504 | + "\n", | |
505 | + " .dataframe thead th {\n", | |
506 | + " text-align: right;\n", | |
507 | + " }\n", | |
508 | + "</style>\n", | |
509 | + "<table border=\"1\" class=\"dataframe\">\n", | |
510 | + " <thead>\n", | |
511 | + " <tr style=\"text-align: right;\">\n", | |
512 | + " <th></th>\n", | |
513 | + " <th>나이</th>\n", | |
514 | + " <th>성별</th>\n", | |
515 | + " <th>키</th>\n", | |
516 | + " <th>체중</th>\n", | |
517 | + " <th>DMI</th>\n", | |
518 | + " </tr>\n", | |
519 | + " <tr>\n", | |
520 | + " <th>이름</th>\n", | |
521 | + " <th></th>\n", | |
522 | + " <th></th>\n", | |
523 | + " <th></th>\n", | |
524 | + " <th></th>\n", | |
525 | + " <th></th>\n", | |
526 | + " </tr>\n", | |
527 | + " </thead>\n", | |
528 | + " <tbody>\n", | |
529 | + " <tr>\n", | |
530 | + " <th>홍길동</th>\n", | |
531 | + " <td>25</td>\n", | |
532 | + " <td>남</td>\n", | |
533 | + " <td>185</td>\n", | |
534 | + " <td>89</td>\n", | |
535 | + " <td>0</td>\n", | |
536 | + " </tr>\n", | |
537 | + " <tr>\n", | |
538 | + " <th>이순신</th>\n", | |
539 | + " <td>19</td>\n", | |
540 | + " <td>여</td>\n", | |
541 | + " <td>163</td>\n", | |
542 | + " <td>53</td>\n", | |
543 | + " <td>0</td>\n", | |
544 | + " </tr>\n", | |
545 | + " <tr>\n", | |
546 | + " <th>유관순</th>\n", | |
547 | + " <td>0</td>\n", | |
548 | + " <td>0</td>\n", | |
549 | + " <td>0</td>\n", | |
550 | + " <td>0</td>\n", | |
551 | + " <td>0</td>\n", | |
552 | + " </tr>\n", | |
553 | + " </tbody>\n", | |
554 | + "</table>\n", | |
555 | + "</div>" | |
556 | + ], | |
557 | + "text/plain": [ | |
558 | + " 나이 성별 키 체중 DMI\n", | |
559 | + "이름 \n", | |
560 | + "홍길동 25 남 185 89 0\n", | |
561 | + "이순신 19 여 163 53 0\n", | |
562 | + "유관순 0 0 0 0 0" | |
563 | + ] | |
564 | + }, | |
565 | + "execution_count": 46, | |
566 | + "metadata": {}, | |
567 | + "output_type": "execute_result" | |
568 | + } | |
569 | + ], | |
570 | + "source": [ | |
571 | + "df" | |
572 | + ] | |
573 | + }, | |
574 | + { | |
575 | + "cell_type": "code", | |
576 | + "execution_count": 63, | |
577 | + "id": "61e5c95a", | |
578 | + "metadata": {}, | |
579 | + "outputs": [], | |
580 | + "source": [ | |
581 | + "df.iloc[2] = [24, '여', 166, 23, 0]" | |
582 | + ] | |
583 | + }, | |
584 | + { | |
585 | + "cell_type": "code", | |
586 | + "execution_count": 64, | |
587 | + "id": "2f37fae4", | |
588 | + "metadata": {}, | |
589 | + "outputs": [ | |
590 | + { | |
591 | + "data": { | |
592 | + "text/html": [ | |
593 | + "<div>\n", | |
594 | + "<style scoped>\n", | |
595 | + " .dataframe tbody tr th:only-of-type {\n", | |
596 | + " vertical-align: middle;\n", | |
597 | + " }\n", | |
598 | + "\n", | |
599 | + " .dataframe tbody tr th {\n", | |
600 | + " vertical-align: top;\n", | |
601 | + " }\n", | |
602 | + "\n", | |
603 | + " .dataframe thead th {\n", | |
604 | + " text-align: right;\n", | |
605 | + " }\n", | |
606 | + "</style>\n", | |
607 | + "<table border=\"1\" class=\"dataframe\">\n", | |
608 | + " <thead>\n", | |
609 | + " <tr style=\"text-align: right;\">\n", | |
610 | + " <th></th>\n", | |
611 | + " <th>나이</th>\n", | |
612 | + " <th>성별</th>\n", | |
613 | + " <th>키</th>\n", | |
614 | + " <th>체중</th>\n", | |
615 | + " <th>DMI</th>\n", | |
616 | + " </tr>\n", | |
617 | + " <tr>\n", | |
618 | + " <th>이름</th>\n", | |
619 | + " <th></th>\n", | |
620 | + " <th></th>\n", | |
621 | + " <th></th>\n", | |
622 | + " <th></th>\n", | |
623 | + " <th></th>\n", | |
624 | + " </tr>\n", | |
625 | + " </thead>\n", | |
626 | + " <tbody>\n", | |
627 | + " <tr>\n", | |
628 | + " <th>홍길동</th>\n", | |
629 | + " <td>25</td>\n", | |
630 | + " <td>남</td>\n", | |
631 | + " <td>185</td>\n", | |
632 | + " <td>89</td>\n", | |
633 | + " <td>0</td>\n", | |
634 | + " </tr>\n", | |
635 | + " <tr>\n", | |
636 | + " <th>이순신</th>\n", | |
637 | + " <td>28</td>\n", | |
638 | + " <td>남</td>\n", | |
639 | + " <td>177</td>\n", | |
640 | + " <td>65</td>\n", | |
641 | + " <td>0</td>\n", | |
642 | + " </tr>\n", | |
643 | + " <tr>\n", | |
644 | + " <th>유관순</th>\n", | |
645 | + " <td>24</td>\n", | |
646 | + " <td>여</td>\n", | |
647 | + " <td>166</td>\n", | |
648 | + " <td>23</td>\n", | |
649 | + " <td>0</td>\n", | |
650 | + " </tr>\n", | |
651 | + " </tbody>\n", | |
652 | + "</table>\n", | |
653 | + "</div>" | |
654 | + ], | |
655 | + "text/plain": [ | |
656 | + " 나이 성별 키 체중 DMI\n", | |
657 | + "이름 \n", | |
658 | + "홍길동 25 남 185 89 0\n", | |
659 | + "이순신 28 남 177 65 0\n", | |
660 | + "유관순 24 여 166 23 0" | |
661 | + ] | |
662 | + }, | |
663 | + "execution_count": 64, | |
664 | + "metadata": {}, | |
665 | + "output_type": "execute_result" | |
666 | + } | |
667 | + ], | |
668 | + "source": [ | |
669 | + "df" | |
670 | + ] | |
671 | + }, | |
672 | + { | |
673 | + "cell_type": "code", | |
674 | + "execution_count": 65, | |
675 | + "id": "5b967150", | |
676 | + "metadata": {}, | |
677 | + "outputs": [ | |
678 | + { | |
679 | + "data": { | |
680 | + "text/plain": [ | |
681 | + "나이 28\n", | |
682 | + "성별 남\n", | |
683 | + "키 177\n", | |
684 | + "체중 65\n", | |
685 | + "DMI 0\n", | |
686 | + "Name: 이순신, dtype: object" | |
687 | + ] | |
688 | + }, | |
689 | + "execution_count": 65, | |
690 | + "metadata": {}, | |
691 | + "output_type": "execute_result" | |
692 | + } | |
693 | + ], | |
694 | + "source": [ | |
695 | + "df.loc['이순신']" | |
696 | + ] | |
697 | + }, | |
698 | + { | |
699 | + "cell_type": "code", | |
700 | + "execution_count": 67, | |
701 | + "id": "da9482ac", | |
702 | + "metadata": {}, | |
703 | + "outputs": [ | |
704 | + { | |
705 | + "data": { | |
706 | + "text/plain": [ | |
707 | + "177" | |
708 | + ] | |
709 | + }, | |
710 | + "execution_count": 67, | |
711 | + "metadata": {}, | |
712 | + "output_type": "execute_result" | |
713 | + } | |
714 | + ], | |
715 | + "source": [ | |
716 | + "df.loc['이순신', '키']" | |
717 | + ] | |
718 | + }, | |
719 | + { | |
720 | + "cell_type": "code", | |
721 | + "execution_count": 68, | |
722 | + "id": "cad4fb14", | |
723 | + "metadata": {}, | |
724 | + "outputs": [ | |
725 | + { | |
726 | + "data": { | |
727 | + "text/plain": [ | |
728 | + "체중 65\n", | |
729 | + "키 177\n", | |
730 | + "Name: 이순신, dtype: object" | |
731 | + ] | |
732 | + }, | |
733 | + "execution_count": 68, | |
734 | + "metadata": {}, | |
735 | + "output_type": "execute_result" | |
736 | + } | |
737 | + ], | |
738 | + "source": [ | |
739 | + "df.loc['이순신', ['체중', '키']]" | |
740 | + ] | |
741 | + }, | |
742 | + { | |
743 | + "cell_type": "code", | |
744 | + "execution_count": null, | |
745 | + "id": "f1fdf9ca", | |
746 | + "metadata": {}, | |
747 | + "outputs": [], | |
748 | + "source": [] | |
749 | + }, | |
750 | + { | |
751 | + "cell_type": "code", | |
752 | + "execution_count": null, | |
753 | + "id": "1bd88754", | |
754 | + "metadata": {}, | |
755 | + "outputs": [], | |
756 | + "source": [] | |
757 | + }, | |
758 | + { | |
759 | + "cell_type": "code", | |
760 | + "execution_count": null, | |
761 | + "id": "7e733b15", | |
762 | + "metadata": {}, | |
763 | + "outputs": [], | |
764 | + "source": [] | |
765 | + }, | |
766 | + { | |
767 | + "cell_type": "code", | |
768 | + "execution_count": null, | |
769 | + "id": "0deb051a", | |
770 | + "metadata": {}, | |
771 | + "outputs": [], | |
772 | + "source": [] | |
773 | + }, | |
774 | + { | |
775 | + "cell_type": "code", | |
776 | + "execution_count": null, | |
777 | + "id": "7be238a4", | |
778 | + "metadata": {}, | |
779 | + "outputs": [], | |
780 | + "source": [] | |
781 | + }, | |
782 | + { | |
783 | + "cell_type": "code", | |
784 | + "execution_count": null, | |
785 | + "id": "387422c4", | |
786 | + "metadata": {}, | |
787 | + "outputs": [], | |
788 | + "source": [] | |
789 | + }, | |
790 | + { | |
791 | + "cell_type": "code", | |
792 | + "execution_count": null, | |
793 | + "id": "2f3f244b", | |
794 | + "metadata": {}, | |
795 | + "outputs": [], | |
796 | + "source": [] | |
797 | + }, | |
798 | + { | |
799 | + "cell_type": "code", | |
800 | + "execution_count": null, | |
801 | + "id": "88f67dfd", | |
802 | + "metadata": {}, | |
803 | + "outputs": [], | |
804 | + "source": [] | |
805 | + }, | |
806 | + { | |
807 | + "cell_type": "code", | |
808 | + "execution_count": null, | |
809 | + "id": "a66ddfaf", | |
810 | + "metadata": {}, | |
811 | + "outputs": [], | |
812 | + "source": [] | |
813 | + } | |
814 | + ], | |
815 | + "metadata": { | |
816 | + "kernelspec": { | |
817 | + "display_name": "Python 3 (ipykernel)", | |
818 | + "language": "python", | |
819 | + "name": "python3" | |
820 | + }, | |
821 | + "language_info": { | |
822 | + "codemirror_mode": { | |
823 | + "name": "ipython", | |
824 | + "version": 3 | |
825 | + }, | |
826 | + "file_extension": ".py", | |
827 | + "mimetype": "text/x-python", | |
828 | + "name": "python", | |
829 | + "nbconvert_exporter": "python", | |
830 | + "pygments_lexer": "ipython3", | |
831 | + "version": "3.9.7" | |
832 | + } | |
833 | + }, | |
834 | + "nbformat": 4, | |
835 | + "nbformat_minor": 5 | |
836 | +} |
+++ 20200502/.ipynb_checkpoints/pandas-checkpoint.ipynb
... | ... | @@ -0,0 +1,1017 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 1, | |
6 | + "id": "1d73f8cb", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import pandas as pd" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 10, | |
16 | + "id": "ee66e1a7", | |
17 | + "metadata": {}, | |
18 | + "outputs": [], | |
19 | + "source": [ | |
20 | + "df = pd.DataFrame([['환자 코드', '연령', '성별', '거주지'],\n", | |
21 | + " ['A00301', 23, '남', '서울시'],\n", | |
22 | + " ['B00809', 53, '여', '제주도']])" | |
23 | + ] | |
24 | + }, | |
25 | + { | |
26 | + "cell_type": "code", | |
27 | + "execution_count": 11, | |
28 | + "id": "a85434e1", | |
29 | + "metadata": {}, | |
30 | + "outputs": [ | |
31 | + { | |
32 | + "data": { | |
33 | + "text/html": [ | |
34 | + "<div>\n", | |
35 | + "<style scoped>\n", | |
36 | + " .dataframe tbody tr th:only-of-type {\n", | |
37 | + " vertical-align: middle;\n", | |
38 | + " }\n", | |
39 | + "\n", | |
40 | + " .dataframe tbody tr th {\n", | |
41 | + " vertical-align: top;\n", | |
42 | + " }\n", | |
43 | + "\n", | |
44 | + " .dataframe thead th {\n", | |
45 | + " text-align: right;\n", | |
46 | + " }\n", | |
47 | + "</style>\n", | |
48 | + "<table border=\"1\" class=\"dataframe\">\n", | |
49 | + " <thead>\n", | |
50 | + " <tr style=\"text-align: right;\">\n", | |
51 | + " <th></th>\n", | |
52 | + " <th>0</th>\n", | |
53 | + " <th>1</th>\n", | |
54 | + " <th>2</th>\n", | |
55 | + " <th>3</th>\n", | |
56 | + " </tr>\n", | |
57 | + " </thead>\n", | |
58 | + " <tbody>\n", | |
59 | + " <tr>\n", | |
60 | + " <th>0</th>\n", | |
61 | + " <td>환자 코드</td>\n", | |
62 | + " <td>연령</td>\n", | |
63 | + " <td>성별</td>\n", | |
64 | + " <td>거주지</td>\n", | |
65 | + " </tr>\n", | |
66 | + " <tr>\n", | |
67 | + " <th>1</th>\n", | |
68 | + " <td>A00301</td>\n", | |
69 | + " <td>23</td>\n", | |
70 | + " <td>남</td>\n", | |
71 | + " <td>서울시</td>\n", | |
72 | + " </tr>\n", | |
73 | + " <tr>\n", | |
74 | + " <th>2</th>\n", | |
75 | + " <td>B00809</td>\n", | |
76 | + " <td>53</td>\n", | |
77 | + " <td>여</td>\n", | |
78 | + " <td>제주도</td>\n", | |
79 | + " </tr>\n", | |
80 | + " </tbody>\n", | |
81 | + "</table>\n", | |
82 | + "</div>" | |
83 | + ], | |
84 | + "text/plain": [ | |
85 | + " 0 1 2 3\n", | |
86 | + "0 환자 코드 연령 성별 거주지\n", | |
87 | + "1 A00301 23 남 서울시\n", | |
88 | + "2 B00809 53 여 제주도" | |
89 | + ] | |
90 | + }, | |
91 | + "execution_count": 11, | |
92 | + "metadata": {}, | |
93 | + "output_type": "execute_result" | |
94 | + } | |
95 | + ], | |
96 | + "source": [ | |
97 | + "df" | |
98 | + ] | |
99 | + }, | |
100 | + { | |
101 | + "cell_type": "code", | |
102 | + "execution_count": 17, | |
103 | + "id": "efd1aa89", | |
104 | + "metadata": {}, | |
105 | + "outputs": [ | |
106 | + { | |
107 | + "data": { | |
108 | + "text/plain": [ | |
109 | + "0 환자 코드\n", | |
110 | + "1 A00301\n", | |
111 | + "2 B00809\n", | |
112 | + "Name: 0, dtype: object" | |
113 | + ] | |
114 | + }, | |
115 | + "execution_count": 17, | |
116 | + "metadata": {}, | |
117 | + "output_type": "execute_result" | |
118 | + } | |
119 | + ], | |
120 | + "source": [ | |
121 | + "df[0]" | |
122 | + ] | |
123 | + }, | |
124 | + { | |
125 | + "cell_type": "code", | |
126 | + "execution_count": 20, | |
127 | + "id": "85b33d0a", | |
128 | + "metadata": {}, | |
129 | + "outputs": [ | |
130 | + { | |
131 | + "data": { | |
132 | + "text/html": [ | |
133 | + "<div>\n", | |
134 | + "<style scoped>\n", | |
135 | + " .dataframe tbody tr th:only-of-type {\n", | |
136 | + " vertical-align: middle;\n", | |
137 | + " }\n", | |
138 | + "\n", | |
139 | + " .dataframe tbody tr th {\n", | |
140 | + " vertical-align: top;\n", | |
141 | + " }\n", | |
142 | + "\n", | |
143 | + " .dataframe thead th {\n", | |
144 | + " text-align: right;\n", | |
145 | + " }\n", | |
146 | + "</style>\n", | |
147 | + "<table border=\"1\" class=\"dataframe\">\n", | |
148 | + " <thead>\n", | |
149 | + " <tr style=\"text-align: right;\">\n", | |
150 | + " <th></th>\n", | |
151 | + " <th>3</th>\n", | |
152 | + " </tr>\n", | |
153 | + " </thead>\n", | |
154 | + " <tbody>\n", | |
155 | + " <tr>\n", | |
156 | + " <th>0</th>\n", | |
157 | + " <td>거주지</td>\n", | |
158 | + " </tr>\n", | |
159 | + " <tr>\n", | |
160 | + " <th>1</th>\n", | |
161 | + " <td>서울시</td>\n", | |
162 | + " </tr>\n", | |
163 | + " <tr>\n", | |
164 | + " <th>2</th>\n", | |
165 | + " <td>제주도</td>\n", | |
166 | + " </tr>\n", | |
167 | + " </tbody>\n", | |
168 | + "</table>\n", | |
169 | + "</div>" | |
170 | + ], | |
171 | + "text/plain": [ | |
172 | + " 3\n", | |
173 | + "0 거주지\n", | |
174 | + "1 서울시\n", | |
175 | + "2 제주도" | |
176 | + ] | |
177 | + }, | |
178 | + "execution_count": 20, | |
179 | + "metadata": {}, | |
180 | + "output_type": "execute_result" | |
181 | + } | |
182 | + ], | |
183 | + "source": [ | |
184 | + "df[[3]]" | |
185 | + ] | |
186 | + }, | |
187 | + { | |
188 | + "cell_type": "code", | |
189 | + "execution_count": 21, | |
190 | + "id": "ae89ed0b", | |
191 | + "metadata": {}, | |
192 | + "outputs": [ | |
193 | + { | |
194 | + "data": { | |
195 | + "text/html": [ | |
196 | + "<div>\n", | |
197 | + "<style scoped>\n", | |
198 | + " .dataframe tbody tr th:only-of-type {\n", | |
199 | + " vertical-align: middle;\n", | |
200 | + " }\n", | |
201 | + "\n", | |
202 | + " .dataframe tbody tr th {\n", | |
203 | + " vertical-align: top;\n", | |
204 | + " }\n", | |
205 | + "\n", | |
206 | + " .dataframe thead th {\n", | |
207 | + " text-align: right;\n", | |
208 | + " }\n", | |
209 | + "</style>\n", | |
210 | + "<table border=\"1\" class=\"dataframe\">\n", | |
211 | + " <thead>\n", | |
212 | + " <tr style=\"text-align: right;\">\n", | |
213 | + " <th></th>\n", | |
214 | + " <th>1</th>\n", | |
215 | + " </tr>\n", | |
216 | + " </thead>\n", | |
217 | + " <tbody>\n", | |
218 | + " <tr>\n", | |
219 | + " <th>0</th>\n", | |
220 | + " <td>연령</td>\n", | |
221 | + " </tr>\n", | |
222 | + " <tr>\n", | |
223 | + " <th>1</th>\n", | |
224 | + " <td>23</td>\n", | |
225 | + " </tr>\n", | |
226 | + " <tr>\n", | |
227 | + " <th>2</th>\n", | |
228 | + " <td>53</td>\n", | |
229 | + " </tr>\n", | |
230 | + " </tbody>\n", | |
231 | + "</table>\n", | |
232 | + "</div>" | |
233 | + ], | |
234 | + "text/plain": [ | |
235 | + " 1\n", | |
236 | + "0 연령\n", | |
237 | + "1 23\n", | |
238 | + "2 53" | |
239 | + ] | |
240 | + }, | |
241 | + "execution_count": 21, | |
242 | + "metadata": {}, | |
243 | + "output_type": "execute_result" | |
244 | + } | |
245 | + ], | |
246 | + "source": [ | |
247 | + "df[[1]]" | |
248 | + ] | |
249 | + }, | |
250 | + { | |
251 | + "cell_type": "code", | |
252 | + "execution_count": 22, | |
253 | + "id": "04962a56", | |
254 | + "metadata": {}, | |
255 | + "outputs": [ | |
256 | + { | |
257 | + "data": { | |
258 | + "text/plain": [ | |
259 | + "pandas.core.series.Series" | |
260 | + ] | |
261 | + }, | |
262 | + "execution_count": 22, | |
263 | + "metadata": {}, | |
264 | + "output_type": "execute_result" | |
265 | + } | |
266 | + ], | |
267 | + "source": [ | |
268 | + "type(df[1])" | |
269 | + ] | |
270 | + }, | |
271 | + { | |
272 | + "cell_type": "code", | |
273 | + "execution_count": 23, | |
274 | + "id": "a4db8d44", | |
275 | + "metadata": {}, | |
276 | + "outputs": [ | |
277 | + { | |
278 | + "data": { | |
279 | + "text/plain": [ | |
280 | + "pandas.core.frame.DataFrame" | |
281 | + ] | |
282 | + }, | |
283 | + "execution_count": 23, | |
284 | + "metadata": {}, | |
285 | + "output_type": "execute_result" | |
286 | + } | |
287 | + ], | |
288 | + "source": [ | |
289 | + "type(df[[1]])" | |
290 | + ] | |
291 | + }, | |
292 | + { | |
293 | + "cell_type": "code", | |
294 | + "execution_count": 24, | |
295 | + "id": "5b384bf6", | |
296 | + "metadata": {}, | |
297 | + "outputs": [ | |
298 | + { | |
299 | + "data": { | |
300 | + "text/plain": [ | |
301 | + "0 환자 코드\n", | |
302 | + "1 연령\n", | |
303 | + "2 성별\n", | |
304 | + "3 거주지\n", | |
305 | + "Name: 0, dtype: object" | |
306 | + ] | |
307 | + }, | |
308 | + "execution_count": 24, | |
309 | + "metadata": {}, | |
310 | + "output_type": "execute_result" | |
311 | + } | |
312 | + ], | |
313 | + "source": [ | |
314 | + "df.loc[0]" | |
315 | + ] | |
316 | + }, | |
317 | + { | |
318 | + "cell_type": "code", | |
319 | + "execution_count": 25, | |
320 | + "id": "72348fc7", | |
321 | + "metadata": {}, | |
322 | + "outputs": [ | |
323 | + { | |
324 | + "data": { | |
325 | + "text/plain": [ | |
326 | + "0 A00301\n", | |
327 | + "1 23\n", | |
328 | + "2 남\n", | |
329 | + "3 서울시\n", | |
330 | + "Name: 1, dtype: object" | |
331 | + ] | |
332 | + }, | |
333 | + "execution_count": 25, | |
334 | + "metadata": {}, | |
335 | + "output_type": "execute_result" | |
336 | + } | |
337 | + ], | |
338 | + "source": [ | |
339 | + "df.loc[1]" | |
340 | + ] | |
341 | + }, | |
342 | + { | |
343 | + "cell_type": "code", | |
344 | + "execution_count": 63, | |
345 | + "id": "cda15c56", | |
346 | + "metadata": {}, | |
347 | + "outputs": [], | |
348 | + "source": [ | |
349 | + "df = pd.DataFrame([['환자 코드', '연령', '성별', '거주지'],\n", | |
350 | + " ['A00301', 23, '남', '서울시'],\n", | |
351 | + " ['B00809', 53, '여', '제주도']],\n", | |
352 | + " index = ['구분', 'A00301', 'B00809'])" | |
353 | + ] | |
354 | + }, | |
355 | + { | |
356 | + "cell_type": "code", | |
357 | + "execution_count": 64, | |
358 | + "id": "329fafc4", | |
359 | + "metadata": {}, | |
360 | + "outputs": [ | |
361 | + { | |
362 | + "data": { | |
363 | + "text/html": [ | |
364 | + "<div>\n", | |
365 | + "<style scoped>\n", | |
366 | + " .dataframe tbody tr th:only-of-type {\n", | |
367 | + " vertical-align: middle;\n", | |
368 | + " }\n", | |
369 | + "\n", | |
370 | + " .dataframe tbody tr th {\n", | |
371 | + " vertical-align: top;\n", | |
372 | + " }\n", | |
373 | + "\n", | |
374 | + " .dataframe thead th {\n", | |
375 | + " text-align: right;\n", | |
376 | + " }\n", | |
377 | + "</style>\n", | |
378 | + "<table border=\"1\" class=\"dataframe\">\n", | |
379 | + " <thead>\n", | |
380 | + " <tr style=\"text-align: right;\">\n", | |
381 | + " <th></th>\n", | |
382 | + " <th>0</th>\n", | |
383 | + " <th>1</th>\n", | |
384 | + " <th>2</th>\n", | |
385 | + " <th>3</th>\n", | |
386 | + " </tr>\n", | |
387 | + " </thead>\n", | |
388 | + " <tbody>\n", | |
389 | + " <tr>\n", | |
390 | + " <th>구분</th>\n", | |
391 | + " <td>환자 코드</td>\n", | |
392 | + " <td>연령</td>\n", | |
393 | + " <td>성별</td>\n", | |
394 | + " <td>거주지</td>\n", | |
395 | + " </tr>\n", | |
396 | + " <tr>\n", | |
397 | + " <th>A00301</th>\n", | |
398 | + " <td>A00301</td>\n", | |
399 | + " <td>23</td>\n", | |
400 | + " <td>남</td>\n", | |
401 | + " <td>서울시</td>\n", | |
402 | + " </tr>\n", | |
403 | + " <tr>\n", | |
404 | + " <th>B00809</th>\n", | |
405 | + " <td>B00809</td>\n", | |
406 | + " <td>53</td>\n", | |
407 | + " <td>여</td>\n", | |
408 | + " <td>제주도</td>\n", | |
409 | + " </tr>\n", | |
410 | + " </tbody>\n", | |
411 | + "</table>\n", | |
412 | + "</div>" | |
413 | + ], | |
414 | + "text/plain": [ | |
415 | + " 0 1 2 3\n", | |
416 | + "구분 환자 코드 연령 성별 거주지\n", | |
417 | + "A00301 A00301 23 남 서울시\n", | |
418 | + "B00809 B00809 53 여 제주도" | |
419 | + ] | |
420 | + }, | |
421 | + "execution_count": 64, | |
422 | + "metadata": {}, | |
423 | + "output_type": "execute_result" | |
424 | + } | |
425 | + ], | |
426 | + "source": [ | |
427 | + "df" | |
428 | + ] | |
429 | + }, | |
430 | + { | |
431 | + "cell_type": "code", | |
432 | + "execution_count": 65, | |
433 | + "id": "833e3041", | |
434 | + "metadata": {}, | |
435 | + "outputs": [ | |
436 | + { | |
437 | + "data": { | |
438 | + "text/html": [ | |
439 | + "<div>\n", | |
440 | + "<style scoped>\n", | |
441 | + " .dataframe tbody tr th:only-of-type {\n", | |
442 | + " vertical-align: middle;\n", | |
443 | + " }\n", | |
444 | + "\n", | |
445 | + " .dataframe tbody tr th {\n", | |
446 | + " vertical-align: top;\n", | |
447 | + " }\n", | |
448 | + "\n", | |
449 | + " .dataframe thead th {\n", | |
450 | + " text-align: right;\n", | |
451 | + " }\n", | |
452 | + "</style>\n", | |
453 | + "<table border=\"1\" class=\"dataframe\">\n", | |
454 | + " <thead>\n", | |
455 | + " <tr style=\"text-align: right;\">\n", | |
456 | + " <th></th>\n", | |
457 | + " <th>0</th>\n", | |
458 | + " <th>1</th>\n", | |
459 | + " <th>2</th>\n", | |
460 | + " <th>3</th>\n", | |
461 | + " </tr>\n", | |
462 | + " </thead>\n", | |
463 | + " <tbody>\n", | |
464 | + " <tr>\n", | |
465 | + " <th>A00301</th>\n", | |
466 | + " <td>A00301</td>\n", | |
467 | + " <td>23</td>\n", | |
468 | + " <td>남</td>\n", | |
469 | + " <td>서울시</td>\n", | |
470 | + " </tr>\n", | |
471 | + " </tbody>\n", | |
472 | + "</table>\n", | |
473 | + "</div>" | |
474 | + ], | |
475 | + "text/plain": [ | |
476 | + " 0 1 2 3\n", | |
477 | + "A00301 A00301 23 남 서울시" | |
478 | + ] | |
479 | + }, | |
480 | + "execution_count": 65, | |
481 | + "metadata": {}, | |
482 | + "output_type": "execute_result" | |
483 | + } | |
484 | + ], | |
485 | + "source": [ | |
486 | + "df.loc[['A00301']]" | |
487 | + ] | |
488 | + }, | |
489 | + { | |
490 | + "cell_type": "code", | |
491 | + "execution_count": 66, | |
492 | + "id": "8671a23d", | |
493 | + "metadata": { | |
494 | + "scrolled": true | |
495 | + }, | |
496 | + "outputs": [ | |
497 | + { | |
498 | + "data": { | |
499 | + "text/html": [ | |
500 | + "<div>\n", | |
501 | + "<style scoped>\n", | |
502 | + " .dataframe tbody tr th:only-of-type {\n", | |
503 | + " vertical-align: middle;\n", | |
504 | + " }\n", | |
505 | + "\n", | |
506 | + " .dataframe tbody tr th {\n", | |
507 | + " vertical-align: top;\n", | |
508 | + " }\n", | |
509 | + "\n", | |
510 | + " .dataframe thead th {\n", | |
511 | + " text-align: right;\n", | |
512 | + " }\n", | |
513 | + "</style>\n", | |
514 | + "<table border=\"1\" class=\"dataframe\">\n", | |
515 | + " <thead>\n", | |
516 | + " <tr style=\"text-align: right;\">\n", | |
517 | + " <th></th>\n", | |
518 | + " <th>0</th>\n", | |
519 | + " <th>1</th>\n", | |
520 | + " <th>2</th>\n", | |
521 | + " <th>3</th>\n", | |
522 | + " </tr>\n", | |
523 | + " </thead>\n", | |
524 | + " <tbody>\n", | |
525 | + " <tr>\n", | |
526 | + " <th>A00301</th>\n", | |
527 | + " <td>A00301</td>\n", | |
528 | + " <td>23</td>\n", | |
529 | + " <td>남</td>\n", | |
530 | + " <td>서울시</td>\n", | |
531 | + " </tr>\n", | |
532 | + " <tr>\n", | |
533 | + " <th>B00809</th>\n", | |
534 | + " <td>B00809</td>\n", | |
535 | + " <td>53</td>\n", | |
536 | + " <td>여</td>\n", | |
537 | + " <td>제주도</td>\n", | |
538 | + " </tr>\n", | |
539 | + " </tbody>\n", | |
540 | + "</table>\n", | |
541 | + "</div>" | |
542 | + ], | |
543 | + "text/plain": [ | |
544 | + " 0 1 2 3\n", | |
545 | + "A00301 A00301 23 남 서울시\n", | |
546 | + "B00809 B00809 53 여 제주도" | |
547 | + ] | |
548 | + }, | |
549 | + "execution_count": 66, | |
550 | + "metadata": {}, | |
551 | + "output_type": "execute_result" | |
552 | + } | |
553 | + ], | |
554 | + "source": [ | |
555 | + "df.iloc[[1, 2]]" | |
556 | + ] | |
557 | + }, | |
558 | + { | |
559 | + "cell_type": "code", | |
560 | + "execution_count": 67, | |
561 | + "id": "58c50e7b", | |
562 | + "metadata": {}, | |
563 | + "outputs": [ | |
564 | + { | |
565 | + "data": { | |
566 | + "text/html": [ | |
567 | + "<div>\n", | |
568 | + "<style scoped>\n", | |
569 | + " .dataframe tbody tr th:only-of-type {\n", | |
570 | + " vertical-align: middle;\n", | |
571 | + " }\n", | |
572 | + "\n", | |
573 | + " .dataframe tbody tr th {\n", | |
574 | + " vertical-align: top;\n", | |
575 | + " }\n", | |
576 | + "\n", | |
577 | + " .dataframe thead th {\n", | |
578 | + " text-align: right;\n", | |
579 | + " }\n", | |
580 | + "</style>\n", | |
581 | + "<table border=\"1\" class=\"dataframe\">\n", | |
582 | + " <thead>\n", | |
583 | + " <tr style=\"text-align: right;\">\n", | |
584 | + " <th></th>\n", | |
585 | + " <th>0</th>\n", | |
586 | + " <th>1</th>\n", | |
587 | + " <th>2</th>\n", | |
588 | + " <th>3</th>\n", | |
589 | + " </tr>\n", | |
590 | + " </thead>\n", | |
591 | + " <tbody>\n", | |
592 | + " <tr>\n", | |
593 | + " <th>구분</th>\n", | |
594 | + " <td>환자 코드</td>\n", | |
595 | + " <td>연령</td>\n", | |
596 | + " <td>성별</td>\n", | |
597 | + " <td>거주지</td>\n", | |
598 | + " </tr>\n", | |
599 | + " <tr>\n", | |
600 | + " <th>A00301</th>\n", | |
601 | + " <td>A00301</td>\n", | |
602 | + " <td>23</td>\n", | |
603 | + " <td>남</td>\n", | |
604 | + " <td>서울시</td>\n", | |
605 | + " </tr>\n", | |
606 | + " <tr>\n", | |
607 | + " <th>B00809</th>\n", | |
608 | + " <td>B00809</td>\n", | |
609 | + " <td>53</td>\n", | |
610 | + " <td>여</td>\n", | |
611 | + " <td>제주도</td>\n", | |
612 | + " </tr>\n", | |
613 | + " </tbody>\n", | |
614 | + "</table>\n", | |
615 | + "</div>" | |
616 | + ], | |
617 | + "text/plain": [ | |
618 | + " 0 1 2 3\n", | |
619 | + "구분 환자 코드 연령 성별 거주지\n", | |
620 | + "A00301 A00301 23 남 서울시\n", | |
621 | + "B00809 B00809 53 여 제주도" | |
622 | + ] | |
623 | + }, | |
624 | + "execution_count": 67, | |
625 | + "metadata": {}, | |
626 | + "output_type": "execute_result" | |
627 | + } | |
628 | + ], | |
629 | + "source": [ | |
630 | + "df.iloc[:]" | |
631 | + ] | |
632 | + }, | |
633 | + { | |
634 | + "cell_type": "code", | |
635 | + "execution_count": 71, | |
636 | + "id": "c3ad0a58", | |
637 | + "metadata": {}, | |
638 | + "outputs": [], | |
639 | + "source": [ | |
640 | + "df = pd.DataFrame([[23, '남', '서울시'],\n", | |
641 | + " [53, '여', '제주도']],\n", | |
642 | + " index = ['A00301', 'B00809'], \n", | |
643 | + " columns = ['연령', '성별', '거주지'])" | |
644 | + ] | |
645 | + }, | |
646 | + { | |
647 | + "cell_type": "code", | |
648 | + "execution_count": 73, | |
649 | + "id": "3020cfc9", | |
650 | + "metadata": {}, | |
651 | + "outputs": [ | |
652 | + { | |
653 | + "data": { | |
654 | + "text/html": [ | |
655 | + "<div>\n", | |
656 | + "<style scoped>\n", | |
657 | + " .dataframe tbody tr th:only-of-type {\n", | |
658 | + " vertical-align: middle;\n", | |
659 | + " }\n", | |
660 | + "\n", | |
661 | + " .dataframe tbody tr th {\n", | |
662 | + " vertical-align: top;\n", | |
663 | + " }\n", | |
664 | + "\n", | |
665 | + " .dataframe thead th {\n", | |
666 | + " text-align: right;\n", | |
667 | + " }\n", | |
668 | + "</style>\n", | |
669 | + "<table border=\"1\" class=\"dataframe\">\n", | |
670 | + " <thead>\n", | |
671 | + " <tr style=\"text-align: right;\">\n", | |
672 | + " <th></th>\n", | |
673 | + " <th>연령</th>\n", | |
674 | + " <th>성별</th>\n", | |
675 | + " <th>거주지</th>\n", | |
676 | + " </tr>\n", | |
677 | + " </thead>\n", | |
678 | + " <tbody>\n", | |
679 | + " <tr>\n", | |
680 | + " <th>A00301</th>\n", | |
681 | + " <td>23</td>\n", | |
682 | + " <td>남</td>\n", | |
683 | + " <td>서울시</td>\n", | |
684 | + " </tr>\n", | |
685 | + " <tr>\n", | |
686 | + " <th>B00809</th>\n", | |
687 | + " <td>53</td>\n", | |
688 | + " <td>여</td>\n", | |
689 | + " <td>제주도</td>\n", | |
690 | + " </tr>\n", | |
691 | + " </tbody>\n", | |
692 | + "</table>\n", | |
693 | + "</div>" | |
694 | + ], | |
695 | + "text/plain": [ | |
696 | + " 연령 성별 거주지\n", | |
697 | + "A00301 23 남 서울시\n", | |
698 | + "B00809 53 여 제주도" | |
699 | + ] | |
700 | + }, | |
701 | + "execution_count": 73, | |
702 | + "metadata": {}, | |
703 | + "output_type": "execute_result" | |
704 | + } | |
705 | + ], | |
706 | + "source": [ | |
707 | + "df" | |
708 | + ] | |
709 | + }, | |
710 | + { | |
711 | + "cell_type": "code", | |
712 | + "execution_count": 74, | |
713 | + "id": "af7b63cd", | |
714 | + "metadata": { | |
715 | + "scrolled": true | |
716 | + }, | |
717 | + "outputs": [ | |
718 | + { | |
719 | + "data": { | |
720 | + "text/plain": [ | |
721 | + "연령 23\n", | |
722 | + "성별 남\n", | |
723 | + "거주지 서울시\n", | |
724 | + "Name: A00301, dtype: object" | |
725 | + ] | |
726 | + }, | |
727 | + "execution_count": 74, | |
728 | + "metadata": {}, | |
729 | + "output_type": "execute_result" | |
730 | + } | |
731 | + ], | |
732 | + "source": [ | |
733 | + "df.loc['A00301']" | |
734 | + ] | |
735 | + }, | |
736 | + { | |
737 | + "cell_type": "code", | |
738 | + "execution_count": 101, | |
739 | + "id": "8b30c291", | |
740 | + "metadata": {}, | |
741 | + "outputs": [], | |
742 | + "source": [ | |
743 | + "df = pd.read_csv(\"./sample.csv\", encoding='euc-kr', index_col='환자코드')" | |
744 | + ] | |
745 | + }, | |
746 | + { | |
747 | + "cell_type": "code", | |
748 | + "execution_count": 102, | |
749 | + "id": "81b4bf0f", | |
750 | + "metadata": {}, | |
751 | + "outputs": [ | |
752 | + { | |
753 | + "data": { | |
754 | + "text/html": [ | |
755 | + "<div>\n", | |
756 | + "<style scoped>\n", | |
757 | + " .dataframe tbody tr th:only-of-type {\n", | |
758 | + " vertical-align: middle;\n", | |
759 | + " }\n", | |
760 | + "\n", | |
761 | + " .dataframe tbody tr th {\n", | |
762 | + " vertical-align: top;\n", | |
763 | + " }\n", | |
764 | + "\n", | |
765 | + " .dataframe thead th {\n", | |
766 | + " text-align: right;\n", | |
767 | + " }\n", | |
768 | + "</style>\n", | |
769 | + "<table border=\"1\" class=\"dataframe\">\n", | |
770 | + " <thead>\n", | |
771 | + " <tr style=\"text-align: right;\">\n", | |
772 | + " <th></th>\n", | |
773 | + " <th>연령</th>\n", | |
774 | + " <th>성별</th>\n", | |
775 | + " <th>거주지</th>\n", | |
776 | + " </tr>\n", | |
777 | + " <tr>\n", | |
778 | + " <th>환자코드</th>\n", | |
779 | + " <th></th>\n", | |
780 | + " <th></th>\n", | |
781 | + " <th></th>\n", | |
782 | + " </tr>\n", | |
783 | + " </thead>\n", | |
784 | + " <tbody>\n", | |
785 | + " <tr>\n", | |
786 | + " <th>A00301</th>\n", | |
787 | + " <td>23</td>\n", | |
788 | + " <td>남</td>\n", | |
789 | + " <td>서울시</td>\n", | |
790 | + " </tr>\n", | |
791 | + " <tr>\n", | |
792 | + " <th>B00809</th>\n", | |
793 | + " <td>53</td>\n", | |
794 | + " <td>여</td>\n", | |
795 | + " <td>제주도</td>\n", | |
796 | + " </tr>\n", | |
797 | + " </tbody>\n", | |
798 | + "</table>\n", | |
799 | + "</div>" | |
800 | + ], | |
801 | + "text/plain": [ | |
802 | + " 연령 성별 거주지\n", | |
803 | + "환자코드 \n", | |
804 | + "A00301 23 남 서울시\n", | |
805 | + "B00809 53 여 제주도" | |
806 | + ] | |
807 | + }, | |
808 | + "execution_count": 102, | |
809 | + "metadata": {}, | |
810 | + "output_type": "execute_result" | |
811 | + } | |
812 | + ], | |
813 | + "source": [ | |
814 | + "df" | |
815 | + ] | |
816 | + }, | |
817 | + { | |
818 | + "cell_type": "code", | |
819 | + "execution_count": 105, | |
820 | + "id": "db6540c0", | |
821 | + "metadata": {}, | |
822 | + "outputs": [], | |
823 | + "source": [ | |
824 | + "df.rename(index={'A00301':'환자1', 'B00809':'환자2'}, inplace=True)" | |
825 | + ] | |
826 | + }, | |
827 | + { | |
828 | + "cell_type": "code", | |
829 | + "execution_count": 106, | |
830 | + "id": "4d0eaed3", | |
831 | + "metadata": {}, | |
832 | + "outputs": [ | |
833 | + { | |
834 | + "data": { | |
835 | + "text/html": [ | |
836 | + "<div>\n", | |
837 | + "<style scoped>\n", | |
838 | + " .dataframe tbody tr th:only-of-type {\n", | |
839 | + " vertical-align: middle;\n", | |
840 | + " }\n", | |
841 | + "\n", | |
842 | + " .dataframe tbody tr th {\n", | |
843 | + " vertical-align: top;\n", | |
844 | + " }\n", | |
845 | + "\n", | |
846 | + " .dataframe thead th {\n", | |
847 | + " text-align: right;\n", | |
848 | + " }\n", | |
849 | + "</style>\n", | |
850 | + "<table border=\"1\" class=\"dataframe\">\n", | |
851 | + " <thead>\n", | |
852 | + " <tr style=\"text-align: right;\">\n", | |
853 | + " <th></th>\n", | |
854 | + " <th>연령</th>\n", | |
855 | + " <th>성별</th>\n", | |
856 | + " <th>거주지</th>\n", | |
857 | + " </tr>\n", | |
858 | + " <tr>\n", | |
859 | + " <th>환자코드</th>\n", | |
860 | + " <th></th>\n", | |
861 | + " <th></th>\n", | |
862 | + " <th></th>\n", | |
863 | + " </tr>\n", | |
864 | + " </thead>\n", | |
865 | + " <tbody>\n", | |
866 | + " <tr>\n", | |
867 | + " <th>환자1</th>\n", | |
868 | + " <td>23</td>\n", | |
869 | + " <td>남</td>\n", | |
870 | + " <td>서울시</td>\n", | |
871 | + " </tr>\n", | |
872 | + " <tr>\n", | |
873 | + " <th>환자2</th>\n", | |
874 | + " <td>53</td>\n", | |
875 | + " <td>여</td>\n", | |
876 | + " <td>제주도</td>\n", | |
877 | + " </tr>\n", | |
878 | + " </tbody>\n", | |
879 | + "</table>\n", | |
880 | + "</div>" | |
881 | + ], | |
882 | + "text/plain": [ | |
883 | + " 연령 성별 거주지\n", | |
884 | + "환자코드 \n", | |
885 | + "환자1 23 남 서울시\n", | |
886 | + "환자2 53 여 제주도" | |
887 | + ] | |
888 | + }, | |
889 | + "execution_count": 106, | |
890 | + "metadata": {}, | |
891 | + "output_type": "execute_result" | |
892 | + } | |
893 | + ], | |
894 | + "source": [ | |
895 | + "df" | |
896 | + ] | |
897 | + }, | |
898 | + { | |
899 | + "cell_type": "code", | |
900 | + "execution_count": 110, | |
901 | + "id": "ed6d5292", | |
902 | + "metadata": {}, | |
903 | + "outputs": [], | |
904 | + "source": [ | |
905 | + "df.rename(columns={'연령':'Age', '성별':'Sex', '거주지':'Addr'}, inplace=True)" | |
906 | + ] | |
907 | + }, | |
908 | + { | |
909 | + "cell_type": "code", | |
910 | + "execution_count": 111, | |
911 | + "id": "d8f2005e", | |
912 | + "metadata": {}, | |
913 | + "outputs": [ | |
914 | + { | |
915 | + "data": { | |
916 | + "text/html": [ | |
917 | + "<div>\n", | |
918 | + "<style scoped>\n", | |
919 | + " .dataframe tbody tr th:only-of-type {\n", | |
920 | + " vertical-align: middle;\n", | |
921 | + " }\n", | |
922 | + "\n", | |
923 | + " .dataframe tbody tr th {\n", | |
924 | + " vertical-align: top;\n", | |
925 | + " }\n", | |
926 | + "\n", | |
927 | + " .dataframe thead th {\n", | |
928 | + " text-align: right;\n", | |
929 | + " }\n", | |
930 | + "</style>\n", | |
931 | + "<table border=\"1\" class=\"dataframe\">\n", | |
932 | + " <thead>\n", | |
933 | + " <tr style=\"text-align: right;\">\n", | |
934 | + " <th></th>\n", | |
935 | + " <th>Age</th>\n", | |
936 | + " <th>Sex</th>\n", | |
937 | + " <th>Addr</th>\n", | |
938 | + " </tr>\n", | |
939 | + " <tr>\n", | |
940 | + " <th>환자코드</th>\n", | |
941 | + " <th></th>\n", | |
942 | + " <th></th>\n", | |
943 | + " <th></th>\n", | |
944 | + " </tr>\n", | |
945 | + " </thead>\n", | |
946 | + " <tbody>\n", | |
947 | + " <tr>\n", | |
948 | + " <th>환자1</th>\n", | |
949 | + " <td>23</td>\n", | |
950 | + " <td>남</td>\n", | |
951 | + " <td>서울시</td>\n", | |
952 | + " </tr>\n", | |
953 | + " <tr>\n", | |
954 | + " <th>환자2</th>\n", | |
955 | + " <td>53</td>\n", | |
956 | + " <td>여</td>\n", | |
957 | + " <td>제주도</td>\n", | |
958 | + " </tr>\n", | |
959 | + " </tbody>\n", | |
960 | + "</table>\n", | |
961 | + "</div>" | |
962 | + ], | |
963 | + "text/plain": [ | |
964 | + " Age Sex Addr\n", | |
965 | + "환자코드 \n", | |
966 | + "환자1 23 남 서울시\n", | |
967 | + "환자2 53 여 제주도" | |
968 | + ] | |
969 | + }, | |
970 | + "execution_count": 111, | |
971 | + "metadata": {}, | |
972 | + "output_type": "execute_result" | |
973 | + } | |
974 | + ], | |
975 | + "source": [ | |
976 | + "df" | |
977 | + ] | |
978 | + }, | |
979 | + { | |
980 | + "cell_type": "code", | |
981 | + "execution_count": null, | |
982 | + "id": "2b391deb", | |
983 | + "metadata": {}, | |
984 | + "outputs": [], | |
985 | + "source": [] | |
986 | + }, | |
987 | + { | |
988 | + "cell_type": "code", | |
989 | + "execution_count": null, | |
990 | + "id": "80ce37bf", | |
991 | + "metadata": {}, | |
992 | + "outputs": [], | |
993 | + "source": [] | |
994 | + } | |
995 | + ], | |
996 | + "metadata": { | |
997 | + "kernelspec": { | |
998 | + "display_name": "Python 3 (ipykernel)", | |
999 | + "language": "python", | |
1000 | + "name": "python3" | |
1001 | + }, | |
1002 | + "language_info": { | |
1003 | + "codemirror_mode": { | |
1004 | + "name": "ipython", | |
1005 | + "version": 3 | |
1006 | + }, | |
1007 | + "file_extension": ".py", | |
1008 | + "mimetype": "text/x-python", | |
1009 | + "name": "python", | |
1010 | + "nbconvert_exporter": "python", | |
1011 | + "pygments_lexer": "ipython3", | |
1012 | + "version": "3.9.7" | |
1013 | + } | |
1014 | + }, | |
1015 | + "nbformat": 4, | |
1016 | + "nbformat_minor": 5 | |
1017 | +} |
+++ 20200502/df.ipynb
... | ... | @@ -0,0 +1,836 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 7, | |
6 | + "id": "d318019a", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import pandas as pd" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 12, | |
16 | + "id": "78fed803", | |
17 | + "metadata": {}, | |
18 | + "outputs": [], | |
19 | + "source": [ | |
20 | + "df = pd.read_csv('./sample2.csv', encoding='euc-kr')" | |
21 | + ] | |
22 | + }, | |
23 | + { | |
24 | + "cell_type": "code", | |
25 | + "execution_count": 13, | |
26 | + "id": "e1a03a23", | |
27 | + "metadata": {}, | |
28 | + "outputs": [ | |
29 | + { | |
30 | + "data": { | |
31 | + "text/html": [ | |
32 | + "<div>\n", | |
33 | + "<style scoped>\n", | |
34 | + " .dataframe tbody tr th:only-of-type {\n", | |
35 | + " vertical-align: middle;\n", | |
36 | + " }\n", | |
37 | + "\n", | |
38 | + " .dataframe tbody tr th {\n", | |
39 | + " vertical-align: top;\n", | |
40 | + " }\n", | |
41 | + "\n", | |
42 | + " .dataframe thead th {\n", | |
43 | + " text-align: right;\n", | |
44 | + " }\n", | |
45 | + "</style>\n", | |
46 | + "<table border=\"1\" class=\"dataframe\">\n", | |
47 | + " <thead>\n", | |
48 | + " <tr style=\"text-align: right;\">\n", | |
49 | + " <th></th>\n", | |
50 | + " <th>이름</th>\n", | |
51 | + " <th>나이</th>\n", | |
52 | + " <th>성별</th>\n", | |
53 | + " <th>키</th>\n", | |
54 | + " <th>체중</th>\n", | |
55 | + " </tr>\n", | |
56 | + " </thead>\n", | |
57 | + " <tbody>\n", | |
58 | + " <tr>\n", | |
59 | + " <th>0</th>\n", | |
60 | + " <td>홍길동</td>\n", | |
61 | + " <td>25</td>\n", | |
62 | + " <td>남</td>\n", | |
63 | + " <td>185</td>\n", | |
64 | + " <td>89</td>\n", | |
65 | + " </tr>\n", | |
66 | + " <tr>\n", | |
67 | + " <th>1</th>\n", | |
68 | + " <td>이순신</td>\n", | |
69 | + " <td>19</td>\n", | |
70 | + " <td>여</td>\n", | |
71 | + " <td>163</td>\n", | |
72 | + " <td>53</td>\n", | |
73 | + " </tr>\n", | |
74 | + " </tbody>\n", | |
75 | + "</table>\n", | |
76 | + "</div>" | |
77 | + ], | |
78 | + "text/plain": [ | |
79 | + " 이름 나이 성별 키 체중\n", | |
80 | + "0 홍길동 25 남 185 89\n", | |
81 | + "1 이순신 19 여 163 53" | |
82 | + ] | |
83 | + }, | |
84 | + "execution_count": 13, | |
85 | + "metadata": {}, | |
86 | + "output_type": "execute_result" | |
87 | + } | |
88 | + ], | |
89 | + "source": [ | |
90 | + "df" | |
91 | + ] | |
92 | + }, | |
93 | + { | |
94 | + "cell_type": "code", | |
95 | + "execution_count": 16, | |
96 | + "id": "8276cfba", | |
97 | + "metadata": {}, | |
98 | + "outputs": [], | |
99 | + "source": [ | |
100 | + "df = df.set_index('이름')" | |
101 | + ] | |
102 | + }, | |
103 | + { | |
104 | + "cell_type": "code", | |
105 | + "execution_count": 17, | |
106 | + "id": "945a1142", | |
107 | + "metadata": {}, | |
108 | + "outputs": [ | |
109 | + { | |
110 | + "data": { | |
111 | + "text/html": [ | |
112 | + "<div>\n", | |
113 | + "<style scoped>\n", | |
114 | + " .dataframe tbody tr th:only-of-type {\n", | |
115 | + " vertical-align: middle;\n", | |
116 | + " }\n", | |
117 | + "\n", | |
118 | + " .dataframe tbody tr th {\n", | |
119 | + " vertical-align: top;\n", | |
120 | + " }\n", | |
121 | + "\n", | |
122 | + " .dataframe thead th {\n", | |
123 | + " text-align: right;\n", | |
124 | + " }\n", | |
125 | + "</style>\n", | |
126 | + "<table border=\"1\" class=\"dataframe\">\n", | |
127 | + " <thead>\n", | |
128 | + " <tr style=\"text-align: right;\">\n", | |
129 | + " <th></th>\n", | |
130 | + " <th>나이</th>\n", | |
131 | + " <th>성별</th>\n", | |
132 | + " <th>키</th>\n", | |
133 | + " <th>체중</th>\n", | |
134 | + " </tr>\n", | |
135 | + " <tr>\n", | |
136 | + " <th>이름</th>\n", | |
137 | + " <th></th>\n", | |
138 | + " <th></th>\n", | |
139 | + " <th></th>\n", | |
140 | + " <th></th>\n", | |
141 | + " </tr>\n", | |
142 | + " </thead>\n", | |
143 | + " <tbody>\n", | |
144 | + " <tr>\n", | |
145 | + " <th>홍길동</th>\n", | |
146 | + " <td>25</td>\n", | |
147 | + " <td>남</td>\n", | |
148 | + " <td>185</td>\n", | |
149 | + " <td>89</td>\n", | |
150 | + " </tr>\n", | |
151 | + " <tr>\n", | |
152 | + " <th>이순신</th>\n", | |
153 | + " <td>19</td>\n", | |
154 | + " <td>여</td>\n", | |
155 | + " <td>163</td>\n", | |
156 | + " <td>53</td>\n", | |
157 | + " </tr>\n", | |
158 | + " </tbody>\n", | |
159 | + "</table>\n", | |
160 | + "</div>" | |
161 | + ], | |
162 | + "text/plain": [ | |
163 | + " 나이 성별 키 체중\n", | |
164 | + "이름 \n", | |
165 | + "홍길동 25 남 185 89\n", | |
166 | + "이순신 19 여 163 53" | |
167 | + ] | |
168 | + }, | |
169 | + "execution_count": 17, | |
170 | + "metadata": {}, | |
171 | + "output_type": "execute_result" | |
172 | + } | |
173 | + ], | |
174 | + "source": [ | |
175 | + "df" | |
176 | + ] | |
177 | + }, | |
178 | + { | |
179 | + "cell_type": "code", | |
180 | + "execution_count": 25, | |
181 | + "id": "111a1c5f", | |
182 | + "metadata": {}, | |
183 | + "outputs": [ | |
184 | + { | |
185 | + "data": { | |
186 | + "text/html": [ | |
187 | + "<div>\n", | |
188 | + "<style scoped>\n", | |
189 | + " .dataframe tbody tr th:only-of-type {\n", | |
190 | + " vertical-align: middle;\n", | |
191 | + " }\n", | |
192 | + "\n", | |
193 | + " .dataframe tbody tr th {\n", | |
194 | + " vertical-align: top;\n", | |
195 | + " }\n", | |
196 | + "\n", | |
197 | + " .dataframe thead th {\n", | |
198 | + " text-align: right;\n", | |
199 | + " }\n", | |
200 | + "</style>\n", | |
201 | + "<table border=\"1\" class=\"dataframe\">\n", | |
202 | + " <thead>\n", | |
203 | + " <tr style=\"text-align: right;\">\n", | |
204 | + " <th></th>\n", | |
205 | + " <th>나이</th>\n", | |
206 | + " <th>성별</th>\n", | |
207 | + " <th>키</th>\n", | |
208 | + " <th>체중</th>\n", | |
209 | + " </tr>\n", | |
210 | + " <tr>\n", | |
211 | + " <th>이름</th>\n", | |
212 | + " <th></th>\n", | |
213 | + " <th></th>\n", | |
214 | + " <th></th>\n", | |
215 | + " <th></th>\n", | |
216 | + " </tr>\n", | |
217 | + " </thead>\n", | |
218 | + " <tbody>\n", | |
219 | + " <tr>\n", | |
220 | + " <th>홍길동</th>\n", | |
221 | + " <td>25</td>\n", | |
222 | + " <td>남</td>\n", | |
223 | + " <td>185</td>\n", | |
224 | + " <td>89</td>\n", | |
225 | + " </tr>\n", | |
226 | + " <tr>\n", | |
227 | + " <th>이순신</th>\n", | |
228 | + " <td>19</td>\n", | |
229 | + " <td>여</td>\n", | |
230 | + " <td>163</td>\n", | |
231 | + " <td>53</td>\n", | |
232 | + " </tr>\n", | |
233 | + " </tbody>\n", | |
234 | + "</table>\n", | |
235 | + "</div>" | |
236 | + ], | |
237 | + "text/plain": [ | |
238 | + " 나이 성별 키 체중\n", | |
239 | + "이름 \n", | |
240 | + "홍길동 25 남 185 89\n", | |
241 | + "이순신 19 여 163 53" | |
242 | + ] | |
243 | + }, | |
244 | + "execution_count": 25, | |
245 | + "metadata": {}, | |
246 | + "output_type": "execute_result" | |
247 | + } | |
248 | + ], | |
249 | + "source": [ | |
250 | + "df.loc[['홍길동', '이순신']]" | |
251 | + ] | |
252 | + }, | |
253 | + { | |
254 | + "cell_type": "code", | |
255 | + "execution_count": 27, | |
256 | + "id": "59442de0", | |
257 | + "metadata": {}, | |
258 | + "outputs": [ | |
259 | + { | |
260 | + "data": { | |
261 | + "text/html": [ | |
262 | + "<div>\n", | |
263 | + "<style scoped>\n", | |
264 | + " .dataframe tbody tr th:only-of-type {\n", | |
265 | + " vertical-align: middle;\n", | |
266 | + " }\n", | |
267 | + "\n", | |
268 | + " .dataframe tbody tr th {\n", | |
269 | + " vertical-align: top;\n", | |
270 | + " }\n", | |
271 | + "\n", | |
272 | + " .dataframe thead th {\n", | |
273 | + " text-align: right;\n", | |
274 | + " }\n", | |
275 | + "</style>\n", | |
276 | + "<table border=\"1\" class=\"dataframe\">\n", | |
277 | + " <thead>\n", | |
278 | + " <tr style=\"text-align: right;\">\n", | |
279 | + " <th></th>\n", | |
280 | + " <th>나이</th>\n", | |
281 | + " </tr>\n", | |
282 | + " <tr>\n", | |
283 | + " <th>이름</th>\n", | |
284 | + " <th></th>\n", | |
285 | + " </tr>\n", | |
286 | + " </thead>\n", | |
287 | + " <tbody>\n", | |
288 | + " <tr>\n", | |
289 | + " <th>홍길동</th>\n", | |
290 | + " <td>25</td>\n", | |
291 | + " </tr>\n", | |
292 | + " <tr>\n", | |
293 | + " <th>이순신</th>\n", | |
294 | + " <td>19</td>\n", | |
295 | + " </tr>\n", | |
296 | + " </tbody>\n", | |
297 | + "</table>\n", | |
298 | + "</div>" | |
299 | + ], | |
300 | + "text/plain": [ | |
301 | + " 나이\n", | |
302 | + "이름 \n", | |
303 | + "홍길동 25\n", | |
304 | + "이순신 19" | |
305 | + ] | |
306 | + }, | |
307 | + "execution_count": 27, | |
308 | + "metadata": {}, | |
309 | + "output_type": "execute_result" | |
310 | + } | |
311 | + ], | |
312 | + "source": [ | |
313 | + "df[['나이']]" | |
314 | + ] | |
315 | + }, | |
316 | + { | |
317 | + "cell_type": "code", | |
318 | + "execution_count": 31, | |
319 | + "id": "9adeed0c", | |
320 | + "metadata": {}, | |
321 | + "outputs": [ | |
322 | + { | |
323 | + "data": { | |
324 | + "text/html": [ | |
325 | + "<div>\n", | |
326 | + "<style scoped>\n", | |
327 | + " .dataframe tbody tr th:only-of-type {\n", | |
328 | + " vertical-align: middle;\n", | |
329 | + " }\n", | |
330 | + "\n", | |
331 | + " .dataframe tbody tr th {\n", | |
332 | + " vertical-align: top;\n", | |
333 | + " }\n", | |
334 | + "\n", | |
335 | + " .dataframe thead th {\n", | |
336 | + " text-align: right;\n", | |
337 | + " }\n", | |
338 | + "</style>\n", | |
339 | + "<table border=\"1\" class=\"dataframe\">\n", | |
340 | + " <thead>\n", | |
341 | + " <tr style=\"text-align: right;\">\n", | |
342 | + " <th></th>\n", | |
343 | + " <th>성별</th>\n", | |
344 | + " <th>키</th>\n", | |
345 | + " <th>체중</th>\n", | |
346 | + " </tr>\n", | |
347 | + " <tr>\n", | |
348 | + " <th>이름</th>\n", | |
349 | + " <th></th>\n", | |
350 | + " <th></th>\n", | |
351 | + " <th></th>\n", | |
352 | + " </tr>\n", | |
353 | + " </thead>\n", | |
354 | + " <tbody>\n", | |
355 | + " <tr>\n", | |
356 | + " <th>홍길동</th>\n", | |
357 | + " <td>남</td>\n", | |
358 | + " <td>185</td>\n", | |
359 | + " <td>89</td>\n", | |
360 | + " </tr>\n", | |
361 | + " <tr>\n", | |
362 | + " <th>이순신</th>\n", | |
363 | + " <td>여</td>\n", | |
364 | + " <td>163</td>\n", | |
365 | + " <td>53</td>\n", | |
366 | + " </tr>\n", | |
367 | + " </tbody>\n", | |
368 | + "</table>\n", | |
369 | + "</div>" | |
370 | + ], | |
371 | + "text/plain": [ | |
372 | + " 성별 키 체중\n", | |
373 | + "이름 \n", | |
374 | + "홍길동 남 185 89\n", | |
375 | + "이순신 여 163 53" | |
376 | + ] | |
377 | + }, | |
378 | + "execution_count": 31, | |
379 | + "metadata": {}, | |
380 | + "output_type": "execute_result" | |
381 | + } | |
382 | + ], | |
383 | + "source": [ | |
384 | + "df[['성별', '키', '체중']]" | |
385 | + ] | |
386 | + }, | |
387 | + { | |
388 | + "cell_type": "code", | |
389 | + "execution_count": 32, | |
390 | + "id": "3e72a447", | |
391 | + "metadata": {}, | |
392 | + "outputs": [], | |
393 | + "source": [ | |
394 | + "df['DMI'] = 0" | |
395 | + ] | |
396 | + }, | |
397 | + { | |
398 | + "cell_type": "code", | |
399 | + "execution_count": 44, | |
400 | + "id": "e9b958e8", | |
401 | + "metadata": {}, | |
402 | + "outputs": [ | |
403 | + { | |
404 | + "data": { | |
405 | + "text/html": [ | |
406 | + "<div>\n", | |
407 | + "<style scoped>\n", | |
408 | + " .dataframe tbody tr th:only-of-type {\n", | |
409 | + " vertical-align: middle;\n", | |
410 | + " }\n", | |
411 | + "\n", | |
412 | + " .dataframe tbody tr th {\n", | |
413 | + " vertical-align: top;\n", | |
414 | + " }\n", | |
415 | + "\n", | |
416 | + " .dataframe thead th {\n", | |
417 | + " text-align: right;\n", | |
418 | + " }\n", | |
419 | + "</style>\n", | |
420 | + "<table border=\"1\" class=\"dataframe\">\n", | |
421 | + " <thead>\n", | |
422 | + " <tr style=\"text-align: right;\">\n", | |
423 | + " <th></th>\n", | |
424 | + " <th>나이</th>\n", | |
425 | + " <th>성별</th>\n", | |
426 | + " <th>키</th>\n", | |
427 | + " <th>체중</th>\n", | |
428 | + " <th>DMI</th>\n", | |
429 | + " </tr>\n", | |
430 | + " <tr>\n", | |
431 | + " <th>이름</th>\n", | |
432 | + " <th></th>\n", | |
433 | + " <th></th>\n", | |
434 | + " <th></th>\n", | |
435 | + " <th></th>\n", | |
436 | + " <th></th>\n", | |
437 | + " </tr>\n", | |
438 | + " </thead>\n", | |
439 | + " <tbody>\n", | |
440 | + " <tr>\n", | |
441 | + " <th>홍길동</th>\n", | |
442 | + " <td>25</td>\n", | |
443 | + " <td>남</td>\n", | |
444 | + " <td>185</td>\n", | |
445 | + " <td>89</td>\n", | |
446 | + " <td>0</td>\n", | |
447 | + " </tr>\n", | |
448 | + " <tr>\n", | |
449 | + " <th>이순신</th>\n", | |
450 | + " <td>19</td>\n", | |
451 | + " <td>여</td>\n", | |
452 | + " <td>163</td>\n", | |
453 | + " <td>53</td>\n", | |
454 | + " <td>0</td>\n", | |
455 | + " </tr>\n", | |
456 | + " </tbody>\n", | |
457 | + "</table>\n", | |
458 | + "</div>" | |
459 | + ], | |
460 | + "text/plain": [ | |
461 | + " 나이 성별 키 체중 DMI\n", | |
462 | + "이름 \n", | |
463 | + "홍길동 25 남 185 89 0\n", | |
464 | + "이순신 19 여 163 53 0" | |
465 | + ] | |
466 | + }, | |
467 | + "execution_count": 44, | |
468 | + "metadata": {}, | |
469 | + "output_type": "execute_result" | |
470 | + } | |
471 | + ], | |
472 | + "source": [ | |
473 | + "df" | |
474 | + ] | |
475 | + }, | |
476 | + { | |
477 | + "cell_type": "code", | |
478 | + "execution_count": 45, | |
479 | + "id": "c435db05", | |
480 | + "metadata": {}, | |
481 | + "outputs": [], | |
482 | + "source": [ | |
483 | + "df.loc['유관순'] = 0" | |
484 | + ] | |
485 | + }, | |
486 | + { | |
487 | + "cell_type": "code", | |
488 | + "execution_count": 46, | |
489 | + "id": "5c13154e", | |
490 | + "metadata": {}, | |
491 | + "outputs": [ | |
492 | + { | |
493 | + "data": { | |
494 | + "text/html": [ | |
495 | + "<div>\n", | |
496 | + "<style scoped>\n", | |
497 | + " .dataframe tbody tr th:only-of-type {\n", | |
498 | + " vertical-align: middle;\n", | |
499 | + " }\n", | |
500 | + "\n", | |
501 | + " .dataframe tbody tr th {\n", | |
502 | + " vertical-align: top;\n", | |
503 | + " }\n", | |
504 | + "\n", | |
505 | + " .dataframe thead th {\n", | |
506 | + " text-align: right;\n", | |
507 | + " }\n", | |
508 | + "</style>\n", | |
509 | + "<table border=\"1\" class=\"dataframe\">\n", | |
510 | + " <thead>\n", | |
511 | + " <tr style=\"text-align: right;\">\n", | |
512 | + " <th></th>\n", | |
513 | + " <th>나이</th>\n", | |
514 | + " <th>성별</th>\n", | |
515 | + " <th>키</th>\n", | |
516 | + " <th>체중</th>\n", | |
517 | + " <th>DMI</th>\n", | |
518 | + " </tr>\n", | |
519 | + " <tr>\n", | |
520 | + " <th>이름</th>\n", | |
521 | + " <th></th>\n", | |
522 | + " <th></th>\n", | |
523 | + " <th></th>\n", | |
524 | + " <th></th>\n", | |
525 | + " <th></th>\n", | |
526 | + " </tr>\n", | |
527 | + " </thead>\n", | |
528 | + " <tbody>\n", | |
529 | + " <tr>\n", | |
530 | + " <th>홍길동</th>\n", | |
531 | + " <td>25</td>\n", | |
532 | + " <td>남</td>\n", | |
533 | + " <td>185</td>\n", | |
534 | + " <td>89</td>\n", | |
535 | + " <td>0</td>\n", | |
536 | + " </tr>\n", | |
537 | + " <tr>\n", | |
538 | + " <th>이순신</th>\n", | |
539 | + " <td>19</td>\n", | |
540 | + " <td>여</td>\n", | |
541 | + " <td>163</td>\n", | |
542 | + " <td>53</td>\n", | |
543 | + " <td>0</td>\n", | |
544 | + " </tr>\n", | |
545 | + " <tr>\n", | |
546 | + " <th>유관순</th>\n", | |
547 | + " <td>0</td>\n", | |
548 | + " <td>0</td>\n", | |
549 | + " <td>0</td>\n", | |
550 | + " <td>0</td>\n", | |
551 | + " <td>0</td>\n", | |
552 | + " </tr>\n", | |
553 | + " </tbody>\n", | |
554 | + "</table>\n", | |
555 | + "</div>" | |
556 | + ], | |
557 | + "text/plain": [ | |
558 | + " 나이 성별 키 체중 DMI\n", | |
559 | + "이름 \n", | |
560 | + "홍길동 25 남 185 89 0\n", | |
561 | + "이순신 19 여 163 53 0\n", | |
562 | + "유관순 0 0 0 0 0" | |
563 | + ] | |
564 | + }, | |
565 | + "execution_count": 46, | |
566 | + "metadata": {}, | |
567 | + "output_type": "execute_result" | |
568 | + } | |
569 | + ], | |
570 | + "source": [ | |
571 | + "df" | |
572 | + ] | |
573 | + }, | |
574 | + { | |
575 | + "cell_type": "code", | |
576 | + "execution_count": 63, | |
577 | + "id": "61e5c95a", | |
578 | + "metadata": {}, | |
579 | + "outputs": [], | |
580 | + "source": [ | |
581 | + "df.iloc[2] = [24, '여', 166, 23, 0]" | |
582 | + ] | |
583 | + }, | |
584 | + { | |
585 | + "cell_type": "code", | |
586 | + "execution_count": 64, | |
587 | + "id": "2f37fae4", | |
588 | + "metadata": {}, | |
589 | + "outputs": [ | |
590 | + { | |
591 | + "data": { | |
592 | + "text/html": [ | |
593 | + "<div>\n", | |
594 | + "<style scoped>\n", | |
595 | + " .dataframe tbody tr th:only-of-type {\n", | |
596 | + " vertical-align: middle;\n", | |
597 | + " }\n", | |
598 | + "\n", | |
599 | + " .dataframe tbody tr th {\n", | |
600 | + " vertical-align: top;\n", | |
601 | + " }\n", | |
602 | + "\n", | |
603 | + " .dataframe thead th {\n", | |
604 | + " text-align: right;\n", | |
605 | + " }\n", | |
606 | + "</style>\n", | |
607 | + "<table border=\"1\" class=\"dataframe\">\n", | |
608 | + " <thead>\n", | |
609 | + " <tr style=\"text-align: right;\">\n", | |
610 | + " <th></th>\n", | |
611 | + " <th>나이</th>\n", | |
612 | + " <th>성별</th>\n", | |
613 | + " <th>키</th>\n", | |
614 | + " <th>체중</th>\n", | |
615 | + " <th>DMI</th>\n", | |
616 | + " </tr>\n", | |
617 | + " <tr>\n", | |
618 | + " <th>이름</th>\n", | |
619 | + " <th></th>\n", | |
620 | + " <th></th>\n", | |
621 | + " <th></th>\n", | |
622 | + " <th></th>\n", | |
623 | + " <th></th>\n", | |
624 | + " </tr>\n", | |
625 | + " </thead>\n", | |
626 | + " <tbody>\n", | |
627 | + " <tr>\n", | |
628 | + " <th>홍길동</th>\n", | |
629 | + " <td>25</td>\n", | |
630 | + " <td>남</td>\n", | |
631 | + " <td>185</td>\n", | |
632 | + " <td>89</td>\n", | |
633 | + " <td>0</td>\n", | |
634 | + " </tr>\n", | |
635 | + " <tr>\n", | |
636 | + " <th>이순신</th>\n", | |
637 | + " <td>28</td>\n", | |
638 | + " <td>남</td>\n", | |
639 | + " <td>177</td>\n", | |
640 | + " <td>65</td>\n", | |
641 | + " <td>0</td>\n", | |
642 | + " </tr>\n", | |
643 | + " <tr>\n", | |
644 | + " <th>유관순</th>\n", | |
645 | + " <td>24</td>\n", | |
646 | + " <td>여</td>\n", | |
647 | + " <td>166</td>\n", | |
648 | + " <td>23</td>\n", | |
649 | + " <td>0</td>\n", | |
650 | + " </tr>\n", | |
651 | + " </tbody>\n", | |
652 | + "</table>\n", | |
653 | + "</div>" | |
654 | + ], | |
655 | + "text/plain": [ | |
656 | + " 나이 성별 키 체중 DMI\n", | |
657 | + "이름 \n", | |
658 | + "홍길동 25 남 185 89 0\n", | |
659 | + "이순신 28 남 177 65 0\n", | |
660 | + "유관순 24 여 166 23 0" | |
661 | + ] | |
662 | + }, | |
663 | + "execution_count": 64, | |
664 | + "metadata": {}, | |
665 | + "output_type": "execute_result" | |
666 | + } | |
667 | + ], | |
668 | + "source": [ | |
669 | + "df" | |
670 | + ] | |
671 | + }, | |
672 | + { | |
673 | + "cell_type": "code", | |
674 | + "execution_count": 65, | |
675 | + "id": "5b967150", | |
676 | + "metadata": {}, | |
677 | + "outputs": [ | |
678 | + { | |
679 | + "data": { | |
680 | + "text/plain": [ | |
681 | + "나이 28\n", | |
682 | + "성별 남\n", | |
683 | + "키 177\n", | |
684 | + "체중 65\n", | |
685 | + "DMI 0\n", | |
686 | + "Name: 이순신, dtype: object" | |
687 | + ] | |
688 | + }, | |
689 | + "execution_count": 65, | |
690 | + "metadata": {}, | |
691 | + "output_type": "execute_result" | |
692 | + } | |
693 | + ], | |
694 | + "source": [ | |
695 | + "df.loc['이순신']" | |
696 | + ] | |
697 | + }, | |
698 | + { | |
699 | + "cell_type": "code", | |
700 | + "execution_count": 67, | |
701 | + "id": "da9482ac", | |
702 | + "metadata": {}, | |
703 | + "outputs": [ | |
704 | + { | |
705 | + "data": { | |
706 | + "text/plain": [ | |
707 | + "177" | |
708 | + ] | |
709 | + }, | |
710 | + "execution_count": 67, | |
711 | + "metadata": {}, | |
712 | + "output_type": "execute_result" | |
713 | + } | |
714 | + ], | |
715 | + "source": [ | |
716 | + "df.loc['이순신', '키']" | |
717 | + ] | |
718 | + }, | |
719 | + { | |
720 | + "cell_type": "code", | |
721 | + "execution_count": 68, | |
722 | + "id": "cad4fb14", | |
723 | + "metadata": {}, | |
724 | + "outputs": [ | |
725 | + { | |
726 | + "data": { | |
727 | + "text/plain": [ | |
728 | + "체중 65\n", | |
729 | + "키 177\n", | |
730 | + "Name: 이순신, dtype: object" | |
731 | + ] | |
732 | + }, | |
733 | + "execution_count": 68, | |
734 | + "metadata": {}, | |
735 | + "output_type": "execute_result" | |
736 | + } | |
737 | + ], | |
738 | + "source": [ | |
739 | + "df.loc['이순신', ['체중', '키']]" | |
740 | + ] | |
741 | + }, | |
742 | + { | |
743 | + "cell_type": "code", | |
744 | + "execution_count": null, | |
745 | + "id": "f1fdf9ca", | |
746 | + "metadata": {}, | |
747 | + "outputs": [], | |
748 | + "source": [] | |
749 | + }, | |
750 | + { | |
751 | + "cell_type": "code", | |
752 | + "execution_count": null, | |
753 | + "id": "1bd88754", | |
754 | + "metadata": {}, | |
755 | + "outputs": [], | |
756 | + "source": [] | |
757 | + }, | |
758 | + { | |
759 | + "cell_type": "code", | |
760 | + "execution_count": null, | |
761 | + "id": "7e733b15", | |
762 | + "metadata": {}, | |
763 | + "outputs": [], | |
764 | + "source": [] | |
765 | + }, | |
766 | + { | |
767 | + "cell_type": "code", | |
768 | + "execution_count": null, | |
769 | + "id": "0deb051a", | |
770 | + "metadata": {}, | |
771 | + "outputs": [], | |
772 | + "source": [] | |
773 | + }, | |
774 | + { | |
775 | + "cell_type": "code", | |
776 | + "execution_count": null, | |
777 | + "id": "7be238a4", | |
778 | + "metadata": {}, | |
779 | + "outputs": [], | |
780 | + "source": [] | |
781 | + }, | |
782 | + { | |
783 | + "cell_type": "code", | |
784 | + "execution_count": null, | |
785 | + "id": "387422c4", | |
786 | + "metadata": {}, | |
787 | + "outputs": [], | |
788 | + "source": [] | |
789 | + }, | |
790 | + { | |
791 | + "cell_type": "code", | |
792 | + "execution_count": null, | |
793 | + "id": "2f3f244b", | |
794 | + "metadata": {}, | |
795 | + "outputs": [], | |
796 | + "source": [] | |
797 | + }, | |
798 | + { | |
799 | + "cell_type": "code", | |
800 | + "execution_count": null, | |
801 | + "id": "88f67dfd", | |
802 | + "metadata": {}, | |
803 | + "outputs": [], | |
804 | + "source": [] | |
805 | + }, | |
806 | + { | |
807 | + "cell_type": "code", | |
808 | + "execution_count": null, | |
809 | + "id": "a66ddfaf", | |
810 | + "metadata": {}, | |
811 | + "outputs": [], | |
812 | + "source": [] | |
813 | + } | |
814 | + ], | |
815 | + "metadata": { | |
816 | + "kernelspec": { | |
817 | + "display_name": "Python 3 (ipykernel)", | |
818 | + "language": "python", | |
819 | + "name": "python3" | |
820 | + }, | |
821 | + "language_info": { | |
822 | + "codemirror_mode": { | |
823 | + "name": "ipython", | |
824 | + "version": 3 | |
825 | + }, | |
826 | + "file_extension": ".py", | |
827 | + "mimetype": "text/x-python", | |
828 | + "name": "python", | |
829 | + "nbconvert_exporter": "python", | |
830 | + "pygments_lexer": "ipython3", | |
831 | + "version": "3.9.7" | |
832 | + } | |
833 | + }, | |
834 | + "nbformat": 4, | |
835 | + "nbformat_minor": 5 | |
836 | +} |
+++ 20200502/pandas.ipynb
... | ... | @@ -0,0 +1,1017 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 1, | |
6 | + "id": "1d73f8cb", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import pandas as pd" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 10, | |
16 | + "id": "ee66e1a7", | |
17 | + "metadata": {}, | |
18 | + "outputs": [], | |
19 | + "source": [ | |
20 | + "df = pd.DataFrame([['환자 코드', '연령', '성별', '거주지'],\n", | |
21 | + " ['A00301', 23, '남', '서울시'],\n", | |
22 | + " ['B00809', 53, '여', '제주도']])" | |
23 | + ] | |
24 | + }, | |
25 | + { | |
26 | + "cell_type": "code", | |
27 | + "execution_count": 11, | |
28 | + "id": "a85434e1", | |
29 | + "metadata": {}, | |
30 | + "outputs": [ | |
31 | + { | |
32 | + "data": { | |
33 | + "text/html": [ | |
34 | + "<div>\n", | |
35 | + "<style scoped>\n", | |
36 | + " .dataframe tbody tr th:only-of-type {\n", | |
37 | + " vertical-align: middle;\n", | |
38 | + " }\n", | |
39 | + "\n", | |
40 | + " .dataframe tbody tr th {\n", | |
41 | + " vertical-align: top;\n", | |
42 | + " }\n", | |
43 | + "\n", | |
44 | + " .dataframe thead th {\n", | |
45 | + " text-align: right;\n", | |
46 | + " }\n", | |
47 | + "</style>\n", | |
48 | + "<table border=\"1\" class=\"dataframe\">\n", | |
49 | + " <thead>\n", | |
50 | + " <tr style=\"text-align: right;\">\n", | |
51 | + " <th></th>\n", | |
52 | + " <th>0</th>\n", | |
53 | + " <th>1</th>\n", | |
54 | + " <th>2</th>\n", | |
55 | + " <th>3</th>\n", | |
56 | + " </tr>\n", | |
57 | + " </thead>\n", | |
58 | + " <tbody>\n", | |
59 | + " <tr>\n", | |
60 | + " <th>0</th>\n", | |
61 | + " <td>환자 코드</td>\n", | |
62 | + " <td>연령</td>\n", | |
63 | + " <td>성별</td>\n", | |
64 | + " <td>거주지</td>\n", | |
65 | + " </tr>\n", | |
66 | + " <tr>\n", | |
67 | + " <th>1</th>\n", | |
68 | + " <td>A00301</td>\n", | |
69 | + " <td>23</td>\n", | |
70 | + " <td>남</td>\n", | |
71 | + " <td>서울시</td>\n", | |
72 | + " </tr>\n", | |
73 | + " <tr>\n", | |
74 | + " <th>2</th>\n", | |
75 | + " <td>B00809</td>\n", | |
76 | + " <td>53</td>\n", | |
77 | + " <td>여</td>\n", | |
78 | + " <td>제주도</td>\n", | |
79 | + " </tr>\n", | |
80 | + " </tbody>\n", | |
81 | + "</table>\n", | |
82 | + "</div>" | |
83 | + ], | |
84 | + "text/plain": [ | |
85 | + " 0 1 2 3\n", | |
86 | + "0 환자 코드 연령 성별 거주지\n", | |
87 | + "1 A00301 23 남 서울시\n", | |
88 | + "2 B00809 53 여 제주도" | |
89 | + ] | |
90 | + }, | |
91 | + "execution_count": 11, | |
92 | + "metadata": {}, | |
93 | + "output_type": "execute_result" | |
94 | + } | |
95 | + ], | |
96 | + "source": [ | |
97 | + "df" | |
98 | + ] | |
99 | + }, | |
100 | + { | |
101 | + "cell_type": "code", | |
102 | + "execution_count": 17, | |
103 | + "id": "efd1aa89", | |
104 | + "metadata": {}, | |
105 | + "outputs": [ | |
106 | + { | |
107 | + "data": { | |
108 | + "text/plain": [ | |
109 | + "0 환자 코드\n", | |
110 | + "1 A00301\n", | |
111 | + "2 B00809\n", | |
112 | + "Name: 0, dtype: object" | |
113 | + ] | |
114 | + }, | |
115 | + "execution_count": 17, | |
116 | + "metadata": {}, | |
117 | + "output_type": "execute_result" | |
118 | + } | |
119 | + ], | |
120 | + "source": [ | |
121 | + "df[0]" | |
122 | + ] | |
123 | + }, | |
124 | + { | |
125 | + "cell_type": "code", | |
126 | + "execution_count": 20, | |
127 | + "id": "85b33d0a", | |
128 | + "metadata": {}, | |
129 | + "outputs": [ | |
130 | + { | |
131 | + "data": { | |
132 | + "text/html": [ | |
133 | + "<div>\n", | |
134 | + "<style scoped>\n", | |
135 | + " .dataframe tbody tr th:only-of-type {\n", | |
136 | + " vertical-align: middle;\n", | |
137 | + " }\n", | |
138 | + "\n", | |
139 | + " .dataframe tbody tr th {\n", | |
140 | + " vertical-align: top;\n", | |
141 | + " }\n", | |
142 | + "\n", | |
143 | + " .dataframe thead th {\n", | |
144 | + " text-align: right;\n", | |
145 | + " }\n", | |
146 | + "</style>\n", | |
147 | + "<table border=\"1\" class=\"dataframe\">\n", | |
148 | + " <thead>\n", | |
149 | + " <tr style=\"text-align: right;\">\n", | |
150 | + " <th></th>\n", | |
151 | + " <th>3</th>\n", | |
152 | + " </tr>\n", | |
153 | + " </thead>\n", | |
154 | + " <tbody>\n", | |
155 | + " <tr>\n", | |
156 | + " <th>0</th>\n", | |
157 | + " <td>거주지</td>\n", | |
158 | + " </tr>\n", | |
159 | + " <tr>\n", | |
160 | + " <th>1</th>\n", | |
161 | + " <td>서울시</td>\n", | |
162 | + " </tr>\n", | |
163 | + " <tr>\n", | |
164 | + " <th>2</th>\n", | |
165 | + " <td>제주도</td>\n", | |
166 | + " </tr>\n", | |
167 | + " </tbody>\n", | |
168 | + "</table>\n", | |
169 | + "</div>" | |
170 | + ], | |
171 | + "text/plain": [ | |
172 | + " 3\n", | |
173 | + "0 거주지\n", | |
174 | + "1 서울시\n", | |
175 | + "2 제주도" | |
176 | + ] | |
177 | + }, | |
178 | + "execution_count": 20, | |
179 | + "metadata": {}, | |
180 | + "output_type": "execute_result" | |
181 | + } | |
182 | + ], | |
183 | + "source": [ | |
184 | + "df[[3]]" | |
185 | + ] | |
186 | + }, | |
187 | + { | |
188 | + "cell_type": "code", | |
189 | + "execution_count": 21, | |
190 | + "id": "ae89ed0b", | |
191 | + "metadata": {}, | |
192 | + "outputs": [ | |
193 | + { | |
194 | + "data": { | |
195 | + "text/html": [ | |
196 | + "<div>\n", | |
197 | + "<style scoped>\n", | |
198 | + " .dataframe tbody tr th:only-of-type {\n", | |
199 | + " vertical-align: middle;\n", | |
200 | + " }\n", | |
201 | + "\n", | |
202 | + " .dataframe tbody tr th {\n", | |
203 | + " vertical-align: top;\n", | |
204 | + " }\n", | |
205 | + "\n", | |
206 | + " .dataframe thead th {\n", | |
207 | + " text-align: right;\n", | |
208 | + " }\n", | |
209 | + "</style>\n", | |
210 | + "<table border=\"1\" class=\"dataframe\">\n", | |
211 | + " <thead>\n", | |
212 | + " <tr style=\"text-align: right;\">\n", | |
213 | + " <th></th>\n", | |
214 | + " <th>1</th>\n", | |
215 | + " </tr>\n", | |
216 | + " </thead>\n", | |
217 | + " <tbody>\n", | |
218 | + " <tr>\n", | |
219 | + " <th>0</th>\n", | |
220 | + " <td>연령</td>\n", | |
221 | + " </tr>\n", | |
222 | + " <tr>\n", | |
223 | + " <th>1</th>\n", | |
224 | + " <td>23</td>\n", | |
225 | + " </tr>\n", | |
226 | + " <tr>\n", | |
227 | + " <th>2</th>\n", | |
228 | + " <td>53</td>\n", | |
229 | + " </tr>\n", | |
230 | + " </tbody>\n", | |
231 | + "</table>\n", | |
232 | + "</div>" | |
233 | + ], | |
234 | + "text/plain": [ | |
235 | + " 1\n", | |
236 | + "0 연령\n", | |
237 | + "1 23\n", | |
238 | + "2 53" | |
239 | + ] | |
240 | + }, | |
241 | + "execution_count": 21, | |
242 | + "metadata": {}, | |
243 | + "output_type": "execute_result" | |
244 | + } | |
245 | + ], | |
246 | + "source": [ | |
247 | + "df[[1]]" | |
248 | + ] | |
249 | + }, | |
250 | + { | |
251 | + "cell_type": "code", | |
252 | + "execution_count": 22, | |
253 | + "id": "04962a56", | |
254 | + "metadata": {}, | |
255 | + "outputs": [ | |
256 | + { | |
257 | + "data": { | |
258 | + "text/plain": [ | |
259 | + "pandas.core.series.Series" | |
260 | + ] | |
261 | + }, | |
262 | + "execution_count": 22, | |
263 | + "metadata": {}, | |
264 | + "output_type": "execute_result" | |
265 | + } | |
266 | + ], | |
267 | + "source": [ | |
268 | + "type(df[1])" | |
269 | + ] | |
270 | + }, | |
271 | + { | |
272 | + "cell_type": "code", | |
273 | + "execution_count": 23, | |
274 | + "id": "a4db8d44", | |
275 | + "metadata": {}, | |
276 | + "outputs": [ | |
277 | + { | |
278 | + "data": { | |
279 | + "text/plain": [ | |
280 | + "pandas.core.frame.DataFrame" | |
281 | + ] | |
282 | + }, | |
283 | + "execution_count": 23, | |
284 | + "metadata": {}, | |
285 | + "output_type": "execute_result" | |
286 | + } | |
287 | + ], | |
288 | + "source": [ | |
289 | + "type(df[[1]])" | |
290 | + ] | |
291 | + }, | |
292 | + { | |
293 | + "cell_type": "code", | |
294 | + "execution_count": 24, | |
295 | + "id": "5b384bf6", | |
296 | + "metadata": {}, | |
297 | + "outputs": [ | |
298 | + { | |
299 | + "data": { | |
300 | + "text/plain": [ | |
301 | + "0 환자 코드\n", | |
302 | + "1 연령\n", | |
303 | + "2 성별\n", | |
304 | + "3 거주지\n", | |
305 | + "Name: 0, dtype: object" | |
306 | + ] | |
307 | + }, | |
308 | + "execution_count": 24, | |
309 | + "metadata": {}, | |
310 | + "output_type": "execute_result" | |
311 | + } | |
312 | + ], | |
313 | + "source": [ | |
314 | + "df.loc[0]" | |
315 | + ] | |
316 | + }, | |
317 | + { | |
318 | + "cell_type": "code", | |
319 | + "execution_count": 25, | |
320 | + "id": "72348fc7", | |
321 | + "metadata": {}, | |
322 | + "outputs": [ | |
323 | + { | |
324 | + "data": { | |
325 | + "text/plain": [ | |
326 | + "0 A00301\n", | |
327 | + "1 23\n", | |
328 | + "2 남\n", | |
329 | + "3 서울시\n", | |
330 | + "Name: 1, dtype: object" | |
331 | + ] | |
332 | + }, | |
333 | + "execution_count": 25, | |
334 | + "metadata": {}, | |
335 | + "output_type": "execute_result" | |
336 | + } | |
337 | + ], | |
338 | + "source": [ | |
339 | + "df.loc[1]" | |
340 | + ] | |
341 | + }, | |
342 | + { | |
343 | + "cell_type": "code", | |
344 | + "execution_count": 63, | |
345 | + "id": "cda15c56", | |
346 | + "metadata": {}, | |
347 | + "outputs": [], | |
348 | + "source": [ | |
349 | + "df = pd.DataFrame([['환자 코드', '연령', '성별', '거주지'],\n", | |
350 | + " ['A00301', 23, '남', '서울시'],\n", | |
351 | + " ['B00809', 53, '여', '제주도']],\n", | |
352 | + " index = ['구분', 'A00301', 'B00809'])" | |
353 | + ] | |
354 | + }, | |
355 | + { | |
356 | + "cell_type": "code", | |
357 | + "execution_count": 64, | |
358 | + "id": "329fafc4", | |
359 | + "metadata": {}, | |
360 | + "outputs": [ | |
361 | + { | |
362 | + "data": { | |
363 | + "text/html": [ | |
364 | + "<div>\n", | |
365 | + "<style scoped>\n", | |
366 | + " .dataframe tbody tr th:only-of-type {\n", | |
367 | + " vertical-align: middle;\n", | |
368 | + " }\n", | |
369 | + "\n", | |
370 | + " .dataframe tbody tr th {\n", | |
371 | + " vertical-align: top;\n", | |
372 | + " }\n", | |
373 | + "\n", | |
374 | + " .dataframe thead th {\n", | |
375 | + " text-align: right;\n", | |
376 | + " }\n", | |
377 | + "</style>\n", | |
378 | + "<table border=\"1\" class=\"dataframe\">\n", | |
379 | + " <thead>\n", | |
380 | + " <tr style=\"text-align: right;\">\n", | |
381 | + " <th></th>\n", | |
382 | + " <th>0</th>\n", | |
383 | + " <th>1</th>\n", | |
384 | + " <th>2</th>\n", | |
385 | + " <th>3</th>\n", | |
386 | + " </tr>\n", | |
387 | + " </thead>\n", | |
388 | + " <tbody>\n", | |
389 | + " <tr>\n", | |
390 | + " <th>구분</th>\n", | |
391 | + " <td>환자 코드</td>\n", | |
392 | + " <td>연령</td>\n", | |
393 | + " <td>성별</td>\n", | |
394 | + " <td>거주지</td>\n", | |
395 | + " </tr>\n", | |
396 | + " <tr>\n", | |
397 | + " <th>A00301</th>\n", | |
398 | + " <td>A00301</td>\n", | |
399 | + " <td>23</td>\n", | |
400 | + " <td>남</td>\n", | |
401 | + " <td>서울시</td>\n", | |
402 | + " </tr>\n", | |
403 | + " <tr>\n", | |
404 | + " <th>B00809</th>\n", | |
405 | + " <td>B00809</td>\n", | |
406 | + " <td>53</td>\n", | |
407 | + " <td>여</td>\n", | |
408 | + " <td>제주도</td>\n", | |
409 | + " </tr>\n", | |
410 | + " </tbody>\n", | |
411 | + "</table>\n", | |
412 | + "</div>" | |
413 | + ], | |
414 | + "text/plain": [ | |
415 | + " 0 1 2 3\n", | |
416 | + "구분 환자 코드 연령 성별 거주지\n", | |
417 | + "A00301 A00301 23 남 서울시\n", | |
418 | + "B00809 B00809 53 여 제주도" | |
419 | + ] | |
420 | + }, | |
421 | + "execution_count": 64, | |
422 | + "metadata": {}, | |
423 | + "output_type": "execute_result" | |
424 | + } | |
425 | + ], | |
426 | + "source": [ | |
427 | + "df" | |
428 | + ] | |
429 | + }, | |
430 | + { | |
431 | + "cell_type": "code", | |
432 | + "execution_count": 65, | |
433 | + "id": "833e3041", | |
434 | + "metadata": {}, | |
435 | + "outputs": [ | |
436 | + { | |
437 | + "data": { | |
438 | + "text/html": [ | |
439 | + "<div>\n", | |
440 | + "<style scoped>\n", | |
441 | + " .dataframe tbody tr th:only-of-type {\n", | |
442 | + " vertical-align: middle;\n", | |
443 | + " }\n", | |
444 | + "\n", | |
445 | + " .dataframe tbody tr th {\n", | |
446 | + " vertical-align: top;\n", | |
447 | + " }\n", | |
448 | + "\n", | |
449 | + " .dataframe thead th {\n", | |
450 | + " text-align: right;\n", | |
451 | + " }\n", | |
452 | + "</style>\n", | |
453 | + "<table border=\"1\" class=\"dataframe\">\n", | |
454 | + " <thead>\n", | |
455 | + " <tr style=\"text-align: right;\">\n", | |
456 | + " <th></th>\n", | |
457 | + " <th>0</th>\n", | |
458 | + " <th>1</th>\n", | |
459 | + " <th>2</th>\n", | |
460 | + " <th>3</th>\n", | |
461 | + " </tr>\n", | |
462 | + " </thead>\n", | |
463 | + " <tbody>\n", | |
464 | + " <tr>\n", | |
465 | + " <th>A00301</th>\n", | |
466 | + " <td>A00301</td>\n", | |
467 | + " <td>23</td>\n", | |
468 | + " <td>남</td>\n", | |
469 | + " <td>서울시</td>\n", | |
470 | + " </tr>\n", | |
471 | + " </tbody>\n", | |
472 | + "</table>\n", | |
473 | + "</div>" | |
474 | + ], | |
475 | + "text/plain": [ | |
476 | + " 0 1 2 3\n", | |
477 | + "A00301 A00301 23 남 서울시" | |
478 | + ] | |
479 | + }, | |
480 | + "execution_count": 65, | |
481 | + "metadata": {}, | |
482 | + "output_type": "execute_result" | |
483 | + } | |
484 | + ], | |
485 | + "source": [ | |
486 | + "df.loc[['A00301']]" | |
487 | + ] | |
488 | + }, | |
489 | + { | |
490 | + "cell_type": "code", | |
491 | + "execution_count": 66, | |
492 | + "id": "8671a23d", | |
493 | + "metadata": { | |
494 | + "scrolled": true | |
495 | + }, | |
496 | + "outputs": [ | |
497 | + { | |
498 | + "data": { | |
499 | + "text/html": [ | |
500 | + "<div>\n", | |
501 | + "<style scoped>\n", | |
502 | + " .dataframe tbody tr th:only-of-type {\n", | |
503 | + " vertical-align: middle;\n", | |
504 | + " }\n", | |
505 | + "\n", | |
506 | + " .dataframe tbody tr th {\n", | |
507 | + " vertical-align: top;\n", | |
508 | + " }\n", | |
509 | + "\n", | |
510 | + " .dataframe thead th {\n", | |
511 | + " text-align: right;\n", | |
512 | + " }\n", | |
513 | + "</style>\n", | |
514 | + "<table border=\"1\" class=\"dataframe\">\n", | |
515 | + " <thead>\n", | |
516 | + " <tr style=\"text-align: right;\">\n", | |
517 | + " <th></th>\n", | |
518 | + " <th>0</th>\n", | |
519 | + " <th>1</th>\n", | |
520 | + " <th>2</th>\n", | |
521 | + " <th>3</th>\n", | |
522 | + " </tr>\n", | |
523 | + " </thead>\n", | |
524 | + " <tbody>\n", | |
525 | + " <tr>\n", | |
526 | + " <th>A00301</th>\n", | |
527 | + " <td>A00301</td>\n", | |
528 | + " <td>23</td>\n", | |
529 | + " <td>남</td>\n", | |
530 | + " <td>서울시</td>\n", | |
531 | + " </tr>\n", | |
532 | + " <tr>\n", | |
533 | + " <th>B00809</th>\n", | |
534 | + " <td>B00809</td>\n", | |
535 | + " <td>53</td>\n", | |
536 | + " <td>여</td>\n", | |
537 | + " <td>제주도</td>\n", | |
538 | + " </tr>\n", | |
539 | + " </tbody>\n", | |
540 | + "</table>\n", | |
541 | + "</div>" | |
542 | + ], | |
543 | + "text/plain": [ | |
544 | + " 0 1 2 3\n", | |
545 | + "A00301 A00301 23 남 서울시\n", | |
546 | + "B00809 B00809 53 여 제주도" | |
547 | + ] | |
548 | + }, | |
549 | + "execution_count": 66, | |
550 | + "metadata": {}, | |
551 | + "output_type": "execute_result" | |
552 | + } | |
553 | + ], | |
554 | + "source": [ | |
555 | + "df.iloc[[1, 2]]" | |
556 | + ] | |
557 | + }, | |
558 | + { | |
559 | + "cell_type": "code", | |
560 | + "execution_count": 67, | |
561 | + "id": "58c50e7b", | |
562 | + "metadata": {}, | |
563 | + "outputs": [ | |
564 | + { | |
565 | + "data": { | |
566 | + "text/html": [ | |
567 | + "<div>\n", | |
568 | + "<style scoped>\n", | |
569 | + " .dataframe tbody tr th:only-of-type {\n", | |
570 | + " vertical-align: middle;\n", | |
571 | + " }\n", | |
572 | + "\n", | |
573 | + " .dataframe tbody tr th {\n", | |
574 | + " vertical-align: top;\n", | |
575 | + " }\n", | |
576 | + "\n", | |
577 | + " .dataframe thead th {\n", | |
578 | + " text-align: right;\n", | |
579 | + " }\n", | |
580 | + "</style>\n", | |
581 | + "<table border=\"1\" class=\"dataframe\">\n", | |
582 | + " <thead>\n", | |
583 | + " <tr style=\"text-align: right;\">\n", | |
584 | + " <th></th>\n", | |
585 | + " <th>0</th>\n", | |
586 | + " <th>1</th>\n", | |
587 | + " <th>2</th>\n", | |
588 | + " <th>3</th>\n", | |
589 | + " </tr>\n", | |
590 | + " </thead>\n", | |
591 | + " <tbody>\n", | |
592 | + " <tr>\n", | |
593 | + " <th>구분</th>\n", | |
594 | + " <td>환자 코드</td>\n", | |
595 | + " <td>연령</td>\n", | |
596 | + " <td>성별</td>\n", | |
597 | + " <td>거주지</td>\n", | |
598 | + " </tr>\n", | |
599 | + " <tr>\n", | |
600 | + " <th>A00301</th>\n", | |
601 | + " <td>A00301</td>\n", | |
602 | + " <td>23</td>\n", | |
603 | + " <td>남</td>\n", | |
604 | + " <td>서울시</td>\n", | |
605 | + " </tr>\n", | |
606 | + " <tr>\n", | |
607 | + " <th>B00809</th>\n", | |
608 | + " <td>B00809</td>\n", | |
609 | + " <td>53</td>\n", | |
610 | + " <td>여</td>\n", | |
611 | + " <td>제주도</td>\n", | |
612 | + " </tr>\n", | |
613 | + " </tbody>\n", | |
614 | + "</table>\n", | |
615 | + "</div>" | |
616 | + ], | |
617 | + "text/plain": [ | |
618 | + " 0 1 2 3\n", | |
619 | + "구분 환자 코드 연령 성별 거주지\n", | |
620 | + "A00301 A00301 23 남 서울시\n", | |
621 | + "B00809 B00809 53 여 제주도" | |
622 | + ] | |
623 | + }, | |
624 | + "execution_count": 67, | |
625 | + "metadata": {}, | |
626 | + "output_type": "execute_result" | |
627 | + } | |
628 | + ], | |
629 | + "source": [ | |
630 | + "df.iloc[:]" | |
631 | + ] | |
632 | + }, | |
633 | + { | |
634 | + "cell_type": "code", | |
635 | + "execution_count": 71, | |
636 | + "id": "c3ad0a58", | |
637 | + "metadata": {}, | |
638 | + "outputs": [], | |
639 | + "source": [ | |
640 | + "df = pd.DataFrame([[23, '남', '서울시'],\n", | |
641 | + " [53, '여', '제주도']],\n", | |
642 | + " index = ['A00301', 'B00809'], \n", | |
643 | + " columns = ['연령', '성별', '거주지'])" | |
644 | + ] | |
645 | + }, | |
646 | + { | |
647 | + "cell_type": "code", | |
648 | + "execution_count": 73, | |
649 | + "id": "3020cfc9", | |
650 | + "metadata": {}, | |
651 | + "outputs": [ | |
652 | + { | |
653 | + "data": { | |
654 | + "text/html": [ | |
655 | + "<div>\n", | |
656 | + "<style scoped>\n", | |
657 | + " .dataframe tbody tr th:only-of-type {\n", | |
658 | + " vertical-align: middle;\n", | |
659 | + " }\n", | |
660 | + "\n", | |
661 | + " .dataframe tbody tr th {\n", | |
662 | + " vertical-align: top;\n", | |
663 | + " }\n", | |
664 | + "\n", | |
665 | + " .dataframe thead th {\n", | |
666 | + " text-align: right;\n", | |
667 | + " }\n", | |
668 | + "</style>\n", | |
669 | + "<table border=\"1\" class=\"dataframe\">\n", | |
670 | + " <thead>\n", | |
671 | + " <tr style=\"text-align: right;\">\n", | |
672 | + " <th></th>\n", | |
673 | + " <th>연령</th>\n", | |
674 | + " <th>성별</th>\n", | |
675 | + " <th>거주지</th>\n", | |
676 | + " </tr>\n", | |
677 | + " </thead>\n", | |
678 | + " <tbody>\n", | |
679 | + " <tr>\n", | |
680 | + " <th>A00301</th>\n", | |
681 | + " <td>23</td>\n", | |
682 | + " <td>남</td>\n", | |
683 | + " <td>서울시</td>\n", | |
684 | + " </tr>\n", | |
685 | + " <tr>\n", | |
686 | + " <th>B00809</th>\n", | |
687 | + " <td>53</td>\n", | |
688 | + " <td>여</td>\n", | |
689 | + " <td>제주도</td>\n", | |
690 | + " </tr>\n", | |
691 | + " </tbody>\n", | |
692 | + "</table>\n", | |
693 | + "</div>" | |
694 | + ], | |
695 | + "text/plain": [ | |
696 | + " 연령 성별 거주지\n", | |
697 | + "A00301 23 남 서울시\n", | |
698 | + "B00809 53 여 제주도" | |
699 | + ] | |
700 | + }, | |
701 | + "execution_count": 73, | |
702 | + "metadata": {}, | |
703 | + "output_type": "execute_result" | |
704 | + } | |
705 | + ], | |
706 | + "source": [ | |
707 | + "df" | |
708 | + ] | |
709 | + }, | |
710 | + { | |
711 | + "cell_type": "code", | |
712 | + "execution_count": 74, | |
713 | + "id": "af7b63cd", | |
714 | + "metadata": { | |
715 | + "scrolled": true | |
716 | + }, | |
717 | + "outputs": [ | |
718 | + { | |
719 | + "data": { | |
720 | + "text/plain": [ | |
721 | + "연령 23\n", | |
722 | + "성별 남\n", | |
723 | + "거주지 서울시\n", | |
724 | + "Name: A00301, dtype: object" | |
725 | + ] | |
726 | + }, | |
727 | + "execution_count": 74, | |
728 | + "metadata": {}, | |
729 | + "output_type": "execute_result" | |
730 | + } | |
731 | + ], | |
732 | + "source": [ | |
733 | + "df.loc['A00301']" | |
734 | + ] | |
735 | + }, | |
736 | + { | |
737 | + "cell_type": "code", | |
738 | + "execution_count": 101, | |
739 | + "id": "8b30c291", | |
740 | + "metadata": {}, | |
741 | + "outputs": [], | |
742 | + "source": [ | |
743 | + "df = pd.read_csv(\"./sample.csv\", encoding='euc-kr', index_col='환자코드')" | |
744 | + ] | |
745 | + }, | |
746 | + { | |
747 | + "cell_type": "code", | |
748 | + "execution_count": 102, | |
749 | + "id": "81b4bf0f", | |
750 | + "metadata": {}, | |
751 | + "outputs": [ | |
752 | + { | |
753 | + "data": { | |
754 | + "text/html": [ | |
755 | + "<div>\n", | |
756 | + "<style scoped>\n", | |
757 | + " .dataframe tbody tr th:only-of-type {\n", | |
758 | + " vertical-align: middle;\n", | |
759 | + " }\n", | |
760 | + "\n", | |
761 | + " .dataframe tbody tr th {\n", | |
762 | + " vertical-align: top;\n", | |
763 | + " }\n", | |
764 | + "\n", | |
765 | + " .dataframe thead th {\n", | |
766 | + " text-align: right;\n", | |
767 | + " }\n", | |
768 | + "</style>\n", | |
769 | + "<table border=\"1\" class=\"dataframe\">\n", | |
770 | + " <thead>\n", | |
771 | + " <tr style=\"text-align: right;\">\n", | |
772 | + " <th></th>\n", | |
773 | + " <th>연령</th>\n", | |
774 | + " <th>성별</th>\n", | |
775 | + " <th>거주지</th>\n", | |
776 | + " </tr>\n", | |
777 | + " <tr>\n", | |
778 | + " <th>환자코드</th>\n", | |
779 | + " <th></th>\n", | |
780 | + " <th></th>\n", | |
781 | + " <th></th>\n", | |
782 | + " </tr>\n", | |
783 | + " </thead>\n", | |
784 | + " <tbody>\n", | |
785 | + " <tr>\n", | |
786 | + " <th>A00301</th>\n", | |
787 | + " <td>23</td>\n", | |
788 | + " <td>남</td>\n", | |
789 | + " <td>서울시</td>\n", | |
790 | + " </tr>\n", | |
791 | + " <tr>\n", | |
792 | + " <th>B00809</th>\n", | |
793 | + " <td>53</td>\n", | |
794 | + " <td>여</td>\n", | |
795 | + " <td>제주도</td>\n", | |
796 | + " </tr>\n", | |
797 | + " </tbody>\n", | |
798 | + "</table>\n", | |
799 | + "</div>" | |
800 | + ], | |
801 | + "text/plain": [ | |
802 | + " 연령 성별 거주지\n", | |
803 | + "환자코드 \n", | |
804 | + "A00301 23 남 서울시\n", | |
805 | + "B00809 53 여 제주도" | |
806 | + ] | |
807 | + }, | |
808 | + "execution_count": 102, | |
809 | + "metadata": {}, | |
810 | + "output_type": "execute_result" | |
811 | + } | |
812 | + ], | |
813 | + "source": [ | |
814 | + "df" | |
815 | + ] | |
816 | + }, | |
817 | + { | |
818 | + "cell_type": "code", | |
819 | + "execution_count": 105, | |
820 | + "id": "db6540c0", | |
821 | + "metadata": {}, | |
822 | + "outputs": [], | |
823 | + "source": [ | |
824 | + "df.rename(index={'A00301':'환자1', 'B00809':'환자2'}, inplace=True)" | |
825 | + ] | |
826 | + }, | |
827 | + { | |
828 | + "cell_type": "code", | |
829 | + "execution_count": 106, | |
830 | + "id": "4d0eaed3", | |
831 | + "metadata": {}, | |
832 | + "outputs": [ | |
833 | + { | |
834 | + "data": { | |
835 | + "text/html": [ | |
836 | + "<div>\n", | |
837 | + "<style scoped>\n", | |
838 | + " .dataframe tbody tr th:only-of-type {\n", | |
839 | + " vertical-align: middle;\n", | |
840 | + " }\n", | |
841 | + "\n", | |
842 | + " .dataframe tbody tr th {\n", | |
843 | + " vertical-align: top;\n", | |
844 | + " }\n", | |
845 | + "\n", | |
846 | + " .dataframe thead th {\n", | |
847 | + " text-align: right;\n", | |
848 | + " }\n", | |
849 | + "</style>\n", | |
850 | + "<table border=\"1\" class=\"dataframe\">\n", | |
851 | + " <thead>\n", | |
852 | + " <tr style=\"text-align: right;\">\n", | |
853 | + " <th></th>\n", | |
854 | + " <th>연령</th>\n", | |
855 | + " <th>성별</th>\n", | |
856 | + " <th>거주지</th>\n", | |
857 | + " </tr>\n", | |
858 | + " <tr>\n", | |
859 | + " <th>환자코드</th>\n", | |
860 | + " <th></th>\n", | |
861 | + " <th></th>\n", | |
862 | + " <th></th>\n", | |
863 | + " </tr>\n", | |
864 | + " </thead>\n", | |
865 | + " <tbody>\n", | |
866 | + " <tr>\n", | |
867 | + " <th>환자1</th>\n", | |
868 | + " <td>23</td>\n", | |
869 | + " <td>남</td>\n", | |
870 | + " <td>서울시</td>\n", | |
871 | + " </tr>\n", | |
872 | + " <tr>\n", | |
873 | + " <th>환자2</th>\n", | |
874 | + " <td>53</td>\n", | |
875 | + " <td>여</td>\n", | |
876 | + " <td>제주도</td>\n", | |
877 | + " </tr>\n", | |
878 | + " </tbody>\n", | |
879 | + "</table>\n", | |
880 | + "</div>" | |
881 | + ], | |
882 | + "text/plain": [ | |
883 | + " 연령 성별 거주지\n", | |
884 | + "환자코드 \n", | |
885 | + "환자1 23 남 서울시\n", | |
886 | + "환자2 53 여 제주도" | |
887 | + ] | |
888 | + }, | |
889 | + "execution_count": 106, | |
890 | + "metadata": {}, | |
891 | + "output_type": "execute_result" | |
892 | + } | |
893 | + ], | |
894 | + "source": [ | |
895 | + "df" | |
896 | + ] | |
897 | + }, | |
898 | + { | |
899 | + "cell_type": "code", | |
900 | + "execution_count": 110, | |
901 | + "id": "ed6d5292", | |
902 | + "metadata": {}, | |
903 | + "outputs": [], | |
904 | + "source": [ | |
905 | + "df.rename(columns={'연령':'Age', '성별':'Sex', '거주지':'Addr'}, inplace=True)" | |
906 | + ] | |
907 | + }, | |
908 | + { | |
909 | + "cell_type": "code", | |
910 | + "execution_count": 111, | |
911 | + "id": "d8f2005e", | |
912 | + "metadata": {}, | |
913 | + "outputs": [ | |
914 | + { | |
915 | + "data": { | |
916 | + "text/html": [ | |
917 | + "<div>\n", | |
918 | + "<style scoped>\n", | |
919 | + " .dataframe tbody tr th:only-of-type {\n", | |
920 | + " vertical-align: middle;\n", | |
921 | + " }\n", | |
922 | + "\n", | |
923 | + " .dataframe tbody tr th {\n", | |
924 | + " vertical-align: top;\n", | |
925 | + " }\n", | |
926 | + "\n", | |
927 | + " .dataframe thead th {\n", | |
928 | + " text-align: right;\n", | |
929 | + " }\n", | |
930 | + "</style>\n", | |
931 | + "<table border=\"1\" class=\"dataframe\">\n", | |
932 | + " <thead>\n", | |
933 | + " <tr style=\"text-align: right;\">\n", | |
934 | + " <th></th>\n", | |
935 | + " <th>Age</th>\n", | |
936 | + " <th>Sex</th>\n", | |
937 | + " <th>Addr</th>\n", | |
938 | + " </tr>\n", | |
939 | + " <tr>\n", | |
940 | + " <th>환자코드</th>\n", | |
941 | + " <th></th>\n", | |
942 | + " <th></th>\n", | |
943 | + " <th></th>\n", | |
944 | + " </tr>\n", | |
945 | + " </thead>\n", | |
946 | + " <tbody>\n", | |
947 | + " <tr>\n", | |
948 | + " <th>환자1</th>\n", | |
949 | + " <td>23</td>\n", | |
950 | + " <td>남</td>\n", | |
951 | + " <td>서울시</td>\n", | |
952 | + " </tr>\n", | |
953 | + " <tr>\n", | |
954 | + " <th>환자2</th>\n", | |
955 | + " <td>53</td>\n", | |
956 | + " <td>여</td>\n", | |
957 | + " <td>제주도</td>\n", | |
958 | + " </tr>\n", | |
959 | + " </tbody>\n", | |
960 | + "</table>\n", | |
961 | + "</div>" | |
962 | + ], | |
963 | + "text/plain": [ | |
964 | + " Age Sex Addr\n", | |
965 | + "환자코드 \n", | |
966 | + "환자1 23 남 서울시\n", | |
967 | + "환자2 53 여 제주도" | |
968 | + ] | |
969 | + }, | |
970 | + "execution_count": 111, | |
971 | + "metadata": {}, | |
972 | + "output_type": "execute_result" | |
973 | + } | |
974 | + ], | |
975 | + "source": [ | |
976 | + "df" | |
977 | + ] | |
978 | + }, | |
979 | + { | |
980 | + "cell_type": "code", | |
981 | + "execution_count": null, | |
982 | + "id": "2b391deb", | |
983 | + "metadata": {}, | |
984 | + "outputs": [], | |
985 | + "source": [] | |
986 | + }, | |
987 | + { | |
988 | + "cell_type": "code", | |
989 | + "execution_count": null, | |
990 | + "id": "80ce37bf", | |
991 | + "metadata": {}, | |
992 | + "outputs": [], | |
993 | + "source": [] | |
994 | + } | |
995 | + ], | |
996 | + "metadata": { | |
997 | + "kernelspec": { | |
998 | + "display_name": "Python 3 (ipykernel)", | |
999 | + "language": "python", | |
1000 | + "name": "python3" | |
1001 | + }, | |
1002 | + "language_info": { | |
1003 | + "codemirror_mode": { | |
1004 | + "name": "ipython", | |
1005 | + "version": 3 | |
1006 | + }, | |
1007 | + "file_extension": ".py", | |
1008 | + "mimetype": "text/x-python", | |
1009 | + "name": "python", | |
1010 | + "nbconvert_exporter": "python", | |
1011 | + "pygments_lexer": "ipython3", | |
1012 | + "version": "3.9.7" | |
1013 | + } | |
1014 | + }, | |
1015 | + "nbformat": 4, | |
1016 | + "nbformat_minor": 5 | |
1017 | +} |
+++ 20200502/sample.csv
... | ... | @@ -0,0 +1,3 @@ |
1 | +ȯÀÚÄÚµå,¿¬·É,¼ºº°,°ÅÁÖÁö | |
2 | +A00301,23,³²,¼¿ï½Ã | |
3 | +B00809,53,¿©,Á¦ÁÖµµ |
+++ 20200502/sample2.csv
... | ... | @@ -0,0 +1,3 @@ |
1 | +À̸§,³ªÀÌ,¼ºº°,Å°,üÁß | |
2 | +È«±æµ¿,25,³²,185,89 | |
3 | +À̼ø½Å,19,¿©,163,53 |
+++ 20220404/.ipynb_checkpoints/list-checkpoint.ipynb
... | ... | @@ -0,0 +1,1071 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 27, | |
6 | + "id": "8cde316d", | |
7 | + "metadata": {}, | |
8 | + "outputs": [ | |
9 | + { | |
10 | + "data": { | |
11 | + "text/plain": [ | |
12 | + "[1, 2, 3]" | |
13 | + ] | |
14 | + }, | |
15 | + "execution_count": 27, | |
16 | + "metadata": {}, | |
17 | + "output_type": "execute_result" | |
18 | + } | |
19 | + ], | |
20 | + "source": [ | |
21 | + "a = [1, 2, 3]\n", | |
22 | + "a" | |
23 | + ] | |
24 | + }, | |
25 | + { | |
26 | + "cell_type": "code", | |
27 | + "execution_count": 28, | |
28 | + "id": "31a658b6", | |
29 | + "metadata": {}, | |
30 | + "outputs": [ | |
31 | + { | |
32 | + "data": { | |
33 | + "text/plain": [ | |
34 | + "['Life', ' is', 'too', 'short']" | |
35 | + ] | |
36 | + }, | |
37 | + "execution_count": 28, | |
38 | + "metadata": {}, | |
39 | + "output_type": "execute_result" | |
40 | + } | |
41 | + ], | |
42 | + "source": [ | |
43 | + "b = [\"Life\", \" is\", \"too\", \"short\"]\n", | |
44 | + "b" | |
45 | + ] | |
46 | + }, | |
47 | + { | |
48 | + "cell_type": "code", | |
49 | + "execution_count": 29, | |
50 | + "id": "af028ec4", | |
51 | + "metadata": {}, | |
52 | + "outputs": [ | |
53 | + { | |
54 | + "data": { | |
55 | + "text/plain": [ | |
56 | + "[1, 2, 'Life', 'is']" | |
57 | + ] | |
58 | + }, | |
59 | + "execution_count": 29, | |
60 | + "metadata": {}, | |
61 | + "output_type": "execute_result" | |
62 | + } | |
63 | + ], | |
64 | + "source": [ | |
65 | + "c = [1, 2, \"Life\", \"is\"]\n", | |
66 | + "c" | |
67 | + ] | |
68 | + }, | |
69 | + { | |
70 | + "cell_type": "code", | |
71 | + "execution_count": 30, | |
72 | + "id": "aed75dc2", | |
73 | + "metadata": {}, | |
74 | + "outputs": [ | |
75 | + { | |
76 | + "data": { | |
77 | + "text/plain": [ | |
78 | + "[1, 2, [3, 4], ['Life', 'is']]" | |
79 | + ] | |
80 | + }, | |
81 | + "execution_count": 30, | |
82 | + "metadata": {}, | |
83 | + "output_type": "execute_result" | |
84 | + } | |
85 | + ], | |
86 | + "source": [ | |
87 | + "d = [1, 2, [3, 4], [\"Life\", \"is\"]]\n", | |
88 | + "d" | |
89 | + ] | |
90 | + }, | |
91 | + { | |
92 | + "cell_type": "code", | |
93 | + "execution_count": 32, | |
94 | + "id": "b9d56702", | |
95 | + "metadata": { | |
96 | + "collapsed": true | |
97 | + }, | |
98 | + "outputs": [ | |
99 | + { | |
100 | + "data": { | |
101 | + "text/plain": [ | |
102 | + "2" | |
103 | + ] | |
104 | + }, | |
105 | + "execution_count": 32, | |
106 | + "metadata": {}, | |
107 | + "output_type": "execute_result" | |
108 | + } | |
109 | + ], | |
110 | + "source": [ | |
111 | + "a[1]" | |
112 | + ] | |
113 | + }, | |
114 | + { | |
115 | + "cell_type": "code", | |
116 | + "execution_count": 33, | |
117 | + "id": "2fdf5bdd", | |
118 | + "metadata": { | |
119 | + "collapsed": true | |
120 | + }, | |
121 | + "outputs": [ | |
122 | + { | |
123 | + "data": { | |
124 | + "text/plain": [ | |
125 | + "'short'" | |
126 | + ] | |
127 | + }, | |
128 | + "execution_count": 33, | |
129 | + "metadata": {}, | |
130 | + "output_type": "execute_result" | |
131 | + } | |
132 | + ], | |
133 | + "source": [ | |
134 | + "b[-1]" | |
135 | + ] | |
136 | + }, | |
137 | + { | |
138 | + "cell_type": "code", | |
139 | + "execution_count": 37, | |
140 | + "id": "a1e6399b", | |
141 | + "metadata": { | |
142 | + "collapsed": true | |
143 | + }, | |
144 | + "outputs": [ | |
145 | + { | |
146 | + "data": { | |
147 | + "text/plain": [ | |
148 | + "4" | |
149 | + ] | |
150 | + }, | |
151 | + "execution_count": 37, | |
152 | + "metadata": {}, | |
153 | + "output_type": "execute_result" | |
154 | + } | |
155 | + ], | |
156 | + "source": [ | |
157 | + "d[2][-1]" | |
158 | + ] | |
159 | + }, | |
160 | + { | |
161 | + "cell_type": "code", | |
162 | + "execution_count": 40, | |
163 | + "id": "698645c1", | |
164 | + "metadata": { | |
165 | + "collapsed": true | |
166 | + }, | |
167 | + "outputs": [ | |
168 | + { | |
169 | + "data": { | |
170 | + "text/plain": [ | |
171 | + "['Life', 'is']" | |
172 | + ] | |
173 | + }, | |
174 | + "execution_count": 40, | |
175 | + "metadata": {}, | |
176 | + "output_type": "execute_result" | |
177 | + } | |
178 | + ], | |
179 | + "source": [ | |
180 | + "d[-1]" | |
181 | + ] | |
182 | + }, | |
183 | + { | |
184 | + "cell_type": "code", | |
185 | + "execution_count": 43, | |
186 | + "id": "9a0e2d6f", | |
187 | + "metadata": { | |
188 | + "collapsed": true | |
189 | + }, | |
190 | + "outputs": [ | |
191 | + { | |
192 | + "data": { | |
193 | + "text/plain": [ | |
194 | + "'Life'" | |
195 | + ] | |
196 | + }, | |
197 | + "execution_count": 43, | |
198 | + "metadata": {}, | |
199 | + "output_type": "execute_result" | |
200 | + } | |
201 | + ], | |
202 | + "source": [ | |
203 | + "d[-1][-2]" | |
204 | + ] | |
205 | + }, | |
206 | + { | |
207 | + "cell_type": "code", | |
208 | + "execution_count": 44, | |
209 | + "id": "f557f756", | |
210 | + "metadata": { | |
211 | + "collapsed": true | |
212 | + }, | |
213 | + "outputs": [ | |
214 | + { | |
215 | + "data": { | |
216 | + "text/plain": [ | |
217 | + "[1, 2, [3, 4]]" | |
218 | + ] | |
219 | + }, | |
220 | + "execution_count": 44, | |
221 | + "metadata": {}, | |
222 | + "output_type": "execute_result" | |
223 | + } | |
224 | + ], | |
225 | + "source": [ | |
226 | + "d[0:3]" | |
227 | + ] | |
228 | + }, | |
229 | + { | |
230 | + "cell_type": "code", | |
231 | + "execution_count": 46, | |
232 | + "id": "313e2152", | |
233 | + "metadata": {}, | |
234 | + "outputs": [ | |
235 | + { | |
236 | + "data": { | |
237 | + "text/plain": [ | |
238 | + "[1, 2, 3, 'Life', ' is', 'too', 'short']" | |
239 | + ] | |
240 | + }, | |
241 | + "execution_count": 46, | |
242 | + "metadata": {}, | |
243 | + "output_type": "execute_result" | |
244 | + } | |
245 | + ], | |
246 | + "source": [ | |
247 | + "a+b" | |
248 | + ] | |
249 | + }, | |
250 | + { | |
251 | + "cell_type": "code", | |
252 | + "execution_count": 49, | |
253 | + "id": "9959a5e2", | |
254 | + "metadata": {}, | |
255 | + "outputs": [ | |
256 | + { | |
257 | + "data": { | |
258 | + "text/plain": [ | |
259 | + "'Life'" | |
260 | + ] | |
261 | + }, | |
262 | + "execution_count": 49, | |
263 | + "metadata": {}, | |
264 | + "output_type": "execute_result" | |
265 | + } | |
266 | + ], | |
267 | + "source": [ | |
268 | + "b[0]" | |
269 | + ] | |
270 | + }, | |
271 | + { | |
272 | + "cell_type": "code", | |
273 | + "execution_count": 53, | |
274 | + "id": "0ead5b30", | |
275 | + "metadata": {}, | |
276 | + "outputs": [ | |
277 | + { | |
278 | + "data": { | |
279 | + "text/plain": [ | |
280 | + "'1hi ~^^`'" | |
281 | + ] | |
282 | + }, | |
283 | + "execution_count": 53, | |
284 | + "metadata": {}, | |
285 | + "output_type": "execute_result" | |
286 | + } | |
287 | + ], | |
288 | + "source": [ | |
289 | + "str(a[0]) + \"hi ~^^`\"" | |
290 | + ] | |
291 | + }, | |
292 | + { | |
293 | + "cell_type": "code", | |
294 | + "execution_count": 54, | |
295 | + "id": "c574311e", | |
296 | + "metadata": {}, | |
297 | + "outputs": [ | |
298 | + { | |
299 | + "data": { | |
300 | + "text/plain": [ | |
301 | + "[1, 2, 3]" | |
302 | + ] | |
303 | + }, | |
304 | + "execution_count": 54, | |
305 | + "metadata": {}, | |
306 | + "output_type": "execute_result" | |
307 | + } | |
308 | + ], | |
309 | + "source": [ | |
310 | + "a" | |
311 | + ] | |
312 | + }, | |
313 | + { | |
314 | + "cell_type": "code", | |
315 | + "execution_count": 61, | |
316 | + "id": "5430555e", | |
317 | + "metadata": {}, | |
318 | + "outputs": [ | |
319 | + { | |
320 | + "data": { | |
321 | + "text/plain": [ | |
322 | + "3" | |
323 | + ] | |
324 | + }, | |
325 | + "execution_count": 61, | |
326 | + "metadata": {}, | |
327 | + "output_type": "execute_result" | |
328 | + } | |
329 | + ], | |
330 | + "source": [ | |
331 | + "int('1') + int('2')" | |
332 | + ] | |
333 | + }, | |
334 | + { | |
335 | + "cell_type": "code", | |
336 | + "execution_count": 62, | |
337 | + "id": "4e293d6c", | |
338 | + "metadata": {}, | |
339 | + "outputs": [ | |
340 | + { | |
341 | + "data": { | |
342 | + "text/plain": [ | |
343 | + "[1, 2, 3, 1, 2, 3, 1, 2, 3]" | |
344 | + ] | |
345 | + }, | |
346 | + "execution_count": 62, | |
347 | + "metadata": {}, | |
348 | + "output_type": "execute_result" | |
349 | + } | |
350 | + ], | |
351 | + "source": [ | |
352 | + "a * 3" | |
353 | + ] | |
354 | + }, | |
355 | + { | |
356 | + "cell_type": "code", | |
357 | + "execution_count": 63, | |
358 | + "id": "4a7633f8", | |
359 | + "metadata": {}, | |
360 | + "outputs": [], | |
361 | + "source": [ | |
362 | + "del a[0]" | |
363 | + ] | |
364 | + }, | |
365 | + { | |
366 | + "cell_type": "code", | |
367 | + "execution_count": 66, | |
368 | + "id": "8e38fefe", | |
369 | + "metadata": {}, | |
370 | + "outputs": [], | |
371 | + "source": [ | |
372 | + "a.insert(0, a)" | |
373 | + ] | |
374 | + }, | |
375 | + { | |
376 | + "cell_type": "code", | |
377 | + "execution_count": 69, | |
378 | + "id": "82628ba6", | |
379 | + "metadata": {}, | |
380 | + "outputs": [], | |
381 | + "source": [ | |
382 | + "del a[1]" | |
383 | + ] | |
384 | + }, | |
385 | + { | |
386 | + "cell_type": "code", | |
387 | + "execution_count": 70, | |
388 | + "id": "de133692", | |
389 | + "metadata": {}, | |
390 | + "outputs": [ | |
391 | + { | |
392 | + "data": { | |
393 | + "text/plain": [ | |
394 | + "[[...], 3]" | |
395 | + ] | |
396 | + }, | |
397 | + "execution_count": 70, | |
398 | + "metadata": {}, | |
399 | + "output_type": "execute_result" | |
400 | + } | |
401 | + ], | |
402 | + "source": [ | |
403 | + "a" | |
404 | + ] | |
405 | + }, | |
406 | + { | |
407 | + "cell_type": "code", | |
408 | + "execution_count": 72, | |
409 | + "id": "240e416a", | |
410 | + "metadata": {}, | |
411 | + "outputs": [ | |
412 | + { | |
413 | + "data": { | |
414 | + "text/plain": [ | |
415 | + "[]" | |
416 | + ] | |
417 | + }, | |
418 | + "execution_count": 72, | |
419 | + "metadata": {}, | |
420 | + "output_type": "execute_result" | |
421 | + } | |
422 | + ], | |
423 | + "source": [ | |
424 | + "del a[0]\n", | |
425 | + "a" | |
426 | + ] | |
427 | + }, | |
428 | + { | |
429 | + "cell_type": "code", | |
430 | + "execution_count": 73, | |
431 | + "id": "1326585c", | |
432 | + "metadata": {}, | |
433 | + "outputs": [], | |
434 | + "source": [ | |
435 | + "a = [1, 2, 3]" | |
436 | + ] | |
437 | + }, | |
438 | + { | |
439 | + "cell_type": "code", | |
440 | + "execution_count": 74, | |
441 | + "id": "0ef8d1be", | |
442 | + "metadata": {}, | |
443 | + "outputs": [ | |
444 | + { | |
445 | + "data": { | |
446 | + "text/plain": [ | |
447 | + "[1, 2, 3]" | |
448 | + ] | |
449 | + }, | |
450 | + "execution_count": 74, | |
451 | + "metadata": {}, | |
452 | + "output_type": "execute_result" | |
453 | + } | |
454 | + ], | |
455 | + "source": [ | |
456 | + "a" | |
457 | + ] | |
458 | + }, | |
459 | + { | |
460 | + "cell_type": "code", | |
461 | + "execution_count": 76, | |
462 | + "id": "5164f42d", | |
463 | + "metadata": {}, | |
464 | + "outputs": [ | |
465 | + { | |
466 | + "data": { | |
467 | + "text/plain": [ | |
468 | + "['a', 'b', 'c']" | |
469 | + ] | |
470 | + }, | |
471 | + "execution_count": 76, | |
472 | + "metadata": {}, | |
473 | + "output_type": "execute_result" | |
474 | + } | |
475 | + ], | |
476 | + "source": [ | |
477 | + "aa = ['a', 'b', 'c']\n", | |
478 | + "aa" | |
479 | + ] | |
480 | + }, | |
481 | + { | |
482 | + "cell_type": "code", | |
483 | + "execution_count": 79, | |
484 | + "id": "e2e38fff", | |
485 | + "metadata": {}, | |
486 | + "outputs": [ | |
487 | + { | |
488 | + "data": { | |
489 | + "text/plain": [ | |
490 | + "['a', 'b', 'd']" | |
491 | + ] | |
492 | + }, | |
493 | + "execution_count": 79, | |
494 | + "metadata": {}, | |
495 | + "output_type": "execute_result" | |
496 | + } | |
497 | + ], | |
498 | + "source": [ | |
499 | + "aa[2] = 'd'\n", | |
500 | + "aa" | |
501 | + ] | |
502 | + }, | |
503 | + { | |
504 | + "cell_type": "code", | |
505 | + "execution_count": 84, | |
506 | + "id": "314b0a27", | |
507 | + "metadata": {}, | |
508 | + "outputs": [ | |
509 | + { | |
510 | + "data": { | |
511 | + "text/plain": [ | |
512 | + "['a', ['x', 'y', 'z'], 'd']" | |
513 | + ] | |
514 | + }, | |
515 | + "execution_count": 84, | |
516 | + "metadata": {}, | |
517 | + "output_type": "execute_result" | |
518 | + } | |
519 | + ], | |
520 | + "source": [ | |
521 | + "aa[1] = ['x', 'y', 'z']\n", | |
522 | + "aa" | |
523 | + ] | |
524 | + }, | |
525 | + { | |
526 | + "cell_type": "code", | |
527 | + "execution_count": 86, | |
528 | + "id": "0037cf3e", | |
529 | + "metadata": {}, | |
530 | + "outputs": [ | |
531 | + { | |
532 | + "data": { | |
533 | + "text/plain": [ | |
534 | + "[1, 2, 99]" | |
535 | + ] | |
536 | + }, | |
537 | + "execution_count": 86, | |
538 | + "metadata": {}, | |
539 | + "output_type": "execute_result" | |
540 | + } | |
541 | + ], | |
542 | + "source": [ | |
543 | + "a[-1] = 99\n", | |
544 | + "a" | |
545 | + ] | |
546 | + }, | |
547 | + { | |
548 | + "cell_type": "code", | |
549 | + "execution_count": 87, | |
550 | + "id": "d64845b1", | |
551 | + "metadata": {}, | |
552 | + "outputs": [], | |
553 | + "source": [ | |
554 | + "a[1:2] = ['a', 'b', 'c']" | |
555 | + ] | |
556 | + }, | |
557 | + { | |
558 | + "cell_type": "code", | |
559 | + "execution_count": 88, | |
560 | + "id": "1aae50c5", | |
561 | + "metadata": {}, | |
562 | + "outputs": [ | |
563 | + { | |
564 | + "data": { | |
565 | + "text/plain": [ | |
566 | + "[1, 'a', 'b', 'c', 99]" | |
567 | + ] | |
568 | + }, | |
569 | + "execution_count": 88, | |
570 | + "metadata": {}, | |
571 | + "output_type": "execute_result" | |
572 | + } | |
573 | + ], | |
574 | + "source": [ | |
575 | + "a" | |
576 | + ] | |
577 | + }, | |
578 | + { | |
579 | + "cell_type": "code", | |
580 | + "execution_count": 89, | |
581 | + "id": "e23db83f", | |
582 | + "metadata": {}, | |
583 | + "outputs": [ | |
584 | + { | |
585 | + "data": { | |
586 | + "text/plain": [ | |
587 | + "[1, 'a', 'b', 'c', ['d', 'e', 'f']]" | |
588 | + ] | |
589 | + }, | |
590 | + "execution_count": 89, | |
591 | + "metadata": {}, | |
592 | + "output_type": "execute_result" | |
593 | + } | |
594 | + ], | |
595 | + "source": [ | |
596 | + "a[-1] = ['d', 'e', 'f']\n", | |
597 | + "a" | |
598 | + ] | |
599 | + }, | |
600 | + { | |
601 | + "cell_type": "code", | |
602 | + "execution_count": 90, | |
603 | + "id": "5d5242e4", | |
604 | + "metadata": {}, | |
605 | + "outputs": [ | |
606 | + { | |
607 | + "data": { | |
608 | + "text/plain": [ | |
609 | + "[1, 'a', 'b', 'c']" | |
610 | + ] | |
611 | + }, | |
612 | + "execution_count": 90, | |
613 | + "metadata": {}, | |
614 | + "output_type": "execute_result" | |
615 | + } | |
616 | + ], | |
617 | + "source": [ | |
618 | + "del a[-1]\n", | |
619 | + "a" | |
620 | + ] | |
621 | + }, | |
622 | + { | |
623 | + "cell_type": "code", | |
624 | + "execution_count": 91, | |
625 | + "id": "5bac08af", | |
626 | + "metadata": {}, | |
627 | + "outputs": [ | |
628 | + { | |
629 | + "data": { | |
630 | + "text/plain": [ | |
631 | + "[1, 'a', 'b', 'c', 5]" | |
632 | + ] | |
633 | + }, | |
634 | + "execution_count": 91, | |
635 | + "metadata": {}, | |
636 | + "output_type": "execute_result" | |
637 | + } | |
638 | + ], | |
639 | + "source": [ | |
640 | + "a.append(5)\n", | |
641 | + "a" | |
642 | + ] | |
643 | + }, | |
644 | + { | |
645 | + "cell_type": "code", | |
646 | + "execution_count": 95, | |
647 | + "id": "168ece29", | |
648 | + "metadata": { | |
649 | + "scrolled": true | |
650 | + }, | |
651 | + "outputs": [ | |
652 | + { | |
653 | + "data": { | |
654 | + "text/plain": [ | |
655 | + "['__add__',\n", | |
656 | + " '__class__',\n", | |
657 | + " '__class_getitem__',\n", | |
658 | + " '__contains__',\n", | |
659 | + " '__delattr__',\n", | |
660 | + " '__delitem__',\n", | |
661 | + " '__dir__',\n", | |
662 | + " '__doc__',\n", | |
663 | + " '__eq__',\n", | |
664 | + " '__format__',\n", | |
665 | + " '__ge__',\n", | |
666 | + " '__getattribute__',\n", | |
667 | + " '__getitem__',\n", | |
668 | + " '__gt__',\n", | |
669 | + " '__hash__',\n", | |
670 | + " '__iadd__',\n", | |
671 | + " '__imul__',\n", | |
672 | + " '__init__',\n", | |
673 | + " '__init_subclass__',\n", | |
674 | + " '__iter__',\n", | |
675 | + " '__le__',\n", | |
676 | + " '__len__',\n", | |
677 | + " '__lt__',\n", | |
678 | + " '__mul__',\n", | |
679 | + " '__ne__',\n", | |
680 | + " '__new__',\n", | |
681 | + " '__reduce__',\n", | |
682 | + " '__reduce_ex__',\n", | |
683 | + " '__repr__',\n", | |
684 | + " '__reversed__',\n", | |
685 | + " '__rmul__',\n", | |
686 | + " '__setattr__',\n", | |
687 | + " '__setitem__',\n", | |
688 | + " '__sizeof__',\n", | |
689 | + " '__str__',\n", | |
690 | + " '__subclasshook__',\n", | |
691 | + " 'append',\n", | |
692 | + " 'clear',\n", | |
693 | + " 'copy',\n", | |
694 | + " 'count',\n", | |
695 | + " 'extend',\n", | |
696 | + " 'index',\n", | |
697 | + " 'insert',\n", | |
698 | + " 'pop',\n", | |
699 | + " 'remove',\n", | |
700 | + " 'reverse',\n", | |
701 | + " 'sort']" | |
702 | + ] | |
703 | + }, | |
704 | + "execution_count": 95, | |
705 | + "metadata": {}, | |
706 | + "output_type": "execute_result" | |
707 | + } | |
708 | + ], | |
709 | + "source": [ | |
710 | + "dir(a)" | |
711 | + ] | |
712 | + }, | |
713 | + { | |
714 | + "cell_type": "code", | |
715 | + "execution_count": 101, | |
716 | + "id": "0a2db3b0", | |
717 | + "metadata": {}, | |
718 | + "outputs": [], | |
719 | + "source": [ | |
720 | + "a= [65, 65, 99, 8, 1, 32]\n", | |
721 | + "a.sort()" | |
722 | + ] | |
723 | + }, | |
724 | + { | |
725 | + "cell_type": "code", | |
726 | + "execution_count": 102, | |
727 | + "id": "38aa5194", | |
728 | + "metadata": {}, | |
729 | + "outputs": [ | |
730 | + { | |
731 | + "data": { | |
732 | + "text/plain": [ | |
733 | + "[1, 8, 32, 65, 65, 99]" | |
734 | + ] | |
735 | + }, | |
736 | + "execution_count": 102, | |
737 | + "metadata": {}, | |
738 | + "output_type": "execute_result" | |
739 | + } | |
740 | + ], | |
741 | + "source": [ | |
742 | + "a" | |
743 | + ] | |
744 | + }, | |
745 | + { | |
746 | + "cell_type": "code", | |
747 | + "execution_count": 103, | |
748 | + "id": "4aaafa7f", | |
749 | + "metadata": {}, | |
750 | + "outputs": [], | |
751 | + "source": [ | |
752 | + "a.reverse()" | |
753 | + ] | |
754 | + }, | |
755 | + { | |
756 | + "cell_type": "code", | |
757 | + "execution_count": 104, | |
758 | + "id": "265f3fd5", | |
759 | + "metadata": {}, | |
760 | + "outputs": [ | |
761 | + { | |
762 | + "data": { | |
763 | + "text/plain": [ | |
764 | + "[99, 65, 65, 32, 8, 1]" | |
765 | + ] | |
766 | + }, | |
767 | + "execution_count": 104, | |
768 | + "metadata": {}, | |
769 | + "output_type": "execute_result" | |
770 | + } | |
771 | + ], | |
772 | + "source": [ | |
773 | + "a" | |
774 | + ] | |
775 | + }, | |
776 | + { | |
777 | + "cell_type": "code", | |
778 | + "execution_count": 107, | |
779 | + "id": "157dd4a1", | |
780 | + "metadata": {}, | |
781 | + "outputs": [ | |
782 | + { | |
783 | + "data": { | |
784 | + "text/plain": [ | |
785 | + "5" | |
786 | + ] | |
787 | + }, | |
788 | + "execution_count": 107, | |
789 | + "metadata": {}, | |
790 | + "output_type": "execute_result" | |
791 | + } | |
792 | + ], | |
793 | + "source": [ | |
794 | + "a.index(1)" | |
795 | + ] | |
796 | + }, | |
797 | + { | |
798 | + "cell_type": "code", | |
799 | + "execution_count": 108, | |
800 | + "id": "82bcebf2", | |
801 | + "metadata": {}, | |
802 | + "outputs": [ | |
803 | + { | |
804 | + "data": { | |
805 | + "text/plain": [ | |
806 | + "[99, 65, 65, 32, 8, 1]" | |
807 | + ] | |
808 | + }, | |
809 | + "execution_count": 108, | |
810 | + "metadata": {}, | |
811 | + "output_type": "execute_result" | |
812 | + } | |
813 | + ], | |
814 | + "source": [ | |
815 | + "a" | |
816 | + ] | |
817 | + }, | |
818 | + { | |
819 | + "cell_type": "code", | |
820 | + "execution_count": 109, | |
821 | + "id": "0e9118f6", | |
822 | + "metadata": {}, | |
823 | + "outputs": [ | |
824 | + { | |
825 | + "data": { | |
826 | + "text/plain": [ | |
827 | + "[5, 'c', 'b', 'a', 1, 55]" | |
828 | + ] | |
829 | + }, | |
830 | + "execution_count": 109, | |
831 | + "metadata": {}, | |
832 | + "output_type": "execute_result" | |
833 | + } | |
834 | + ], | |
835 | + "source": [ | |
836 | + "a = [5, 'c', 'b', 'a', 1, 55]\n", | |
837 | + "a" | |
838 | + ] | |
839 | + }, | |
840 | + { | |
841 | + "cell_type": "code", | |
842 | + "execution_count": 110, | |
843 | + "id": "8d08f643", | |
844 | + "metadata": {}, | |
845 | + "outputs": [ | |
846 | + { | |
847 | + "data": { | |
848 | + "text/plain": [ | |
849 | + "[5, 88, 'c', 'b', 'a', 1, 55]" | |
850 | + ] | |
851 | + }, | |
852 | + "execution_count": 110, | |
853 | + "metadata": {}, | |
854 | + "output_type": "execute_result" | |
855 | + } | |
856 | + ], | |
857 | + "source": [ | |
858 | + "a.insert(1, 88)\n", | |
859 | + "a" | |
860 | + ] | |
861 | + }, | |
862 | + { | |
863 | + "cell_type": "code", | |
864 | + "execution_count": 111, | |
865 | + "id": "b717dcac", | |
866 | + "metadata": {}, | |
867 | + "outputs": [ | |
868 | + { | |
869 | + "data": { | |
870 | + "text/plain": [ | |
871 | + "[5, 88, 'c', 'b', 'Hello', 'a', 1, 55]" | |
872 | + ] | |
873 | + }, | |
874 | + "execution_count": 111, | |
875 | + "metadata": {}, | |
876 | + "output_type": "execute_result" | |
877 | + } | |
878 | + ], | |
879 | + "source": [ | |
880 | + "a.insert(4, \"Hello\")\n", | |
881 | + "a" | |
882 | + ] | |
883 | + }, | |
884 | + { | |
885 | + "cell_type": "code", | |
886 | + "execution_count": 112, | |
887 | + "id": "604d77dd", | |
888 | + "metadata": {}, | |
889 | + "outputs": [ | |
890 | + { | |
891 | + "data": { | |
892 | + "text/plain": [ | |
893 | + "[5, 'c', 'b', 'Hello', 'a', 1, 55]" | |
894 | + ] | |
895 | + }, | |
896 | + "execution_count": 112, | |
897 | + "metadata": {}, | |
898 | + "output_type": "execute_result" | |
899 | + } | |
900 | + ], | |
901 | + "source": [ | |
902 | + "del a[1]\n", | |
903 | + "a" | |
904 | + ] | |
905 | + }, | |
906 | + { | |
907 | + "cell_type": "code", | |
908 | + "execution_count": 113, | |
909 | + "id": "de2baeaf", | |
910 | + "metadata": {}, | |
911 | + "outputs": [], | |
912 | + "source": [ | |
913 | + "a.remove('Hello')" | |
914 | + ] | |
915 | + }, | |
916 | + { | |
917 | + "cell_type": "code", | |
918 | + "execution_count": 114, | |
919 | + "id": "b1679dcf", | |
920 | + "metadata": {}, | |
921 | + "outputs": [ | |
922 | + { | |
923 | + "data": { | |
924 | + "text/plain": [ | |
925 | + "[5, 'c', 'b', 'a', 1, 55]" | |
926 | + ] | |
927 | + }, | |
928 | + "execution_count": 114, | |
929 | + "metadata": {}, | |
930 | + "output_type": "execute_result" | |
931 | + } | |
932 | + ], | |
933 | + "source": [ | |
934 | + "a" | |
935 | + ] | |
936 | + }, | |
937 | + { | |
938 | + "cell_type": "code", | |
939 | + "execution_count": null, | |
940 | + "id": "69927842", | |
941 | + "metadata": {}, | |
942 | + "outputs": [], | |
943 | + "source": [] | |
944 | + }, | |
945 | + { | |
946 | + "cell_type": "code", | |
947 | + "execution_count": null, | |
948 | + "id": "702e5b62", | |
949 | + "metadata": {}, | |
950 | + "outputs": [], | |
951 | + "source": [] | |
952 | + }, | |
953 | + { | |
954 | + "cell_type": "code", | |
955 | + "execution_count": null, | |
956 | + "id": "7c304140", | |
957 | + "metadata": {}, | |
958 | + "outputs": [], | |
959 | + "source": [] | |
960 | + }, | |
961 | + { | |
962 | + "cell_type": "code", | |
963 | + "execution_count": null, | |
964 | + "id": "3d5e038d", | |
965 | + "metadata": {}, | |
966 | + "outputs": [], | |
967 | + "source": [] | |
968 | + }, | |
969 | + { | |
970 | + "cell_type": "code", | |
971 | + "execution_count": null, | |
972 | + "id": "b82f2523", | |
973 | + "metadata": {}, | |
974 | + "outputs": [], | |
975 | + "source": [] | |
976 | + }, | |
977 | + { | |
978 | + "cell_type": "code", | |
979 | + "execution_count": null, | |
980 | + "id": "a04aa98c", | |
981 | + "metadata": {}, | |
982 | + "outputs": [], | |
983 | + "source": [] | |
984 | + }, | |
985 | + { | |
986 | + "cell_type": "code", | |
987 | + "execution_count": null, | |
988 | + "id": "2c00c223", | |
989 | + "metadata": {}, | |
990 | + "outputs": [], | |
991 | + "source": [] | |
992 | + }, | |
993 | + { | |
994 | + "cell_type": "code", | |
995 | + "execution_count": null, | |
996 | + "id": "e4f1ff19", | |
997 | + "metadata": {}, | |
998 | + "outputs": [], | |
999 | + "source": [] | |
1000 | + }, | |
1001 | + { | |
1002 | + "cell_type": "code", | |
1003 | + "execution_count": null, | |
1004 | + "id": "5195397a", | |
1005 | + "metadata": {}, | |
1006 | + "outputs": [], | |
1007 | + "source": [] | |
1008 | + }, | |
1009 | + { | |
1010 | + "cell_type": "code", | |
1011 | + "execution_count": null, | |
1012 | + "id": "62f42eb5", | |
1013 | + "metadata": {}, | |
1014 | + "outputs": [], | |
1015 | + "source": [] | |
1016 | + }, | |
1017 | + { | |
1018 | + "cell_type": "code", | |
1019 | + "execution_count": null, | |
1020 | + "id": "44eaef61", | |
1021 | + "metadata": {}, | |
1022 | + "outputs": [], | |
1023 | + "source": [] | |
1024 | + }, | |
1025 | + { | |
1026 | + "cell_type": "code", | |
1027 | + "execution_count": null, | |
1028 | + "id": "a75af6bc", | |
1029 | + "metadata": {}, | |
1030 | + "outputs": [], | |
1031 | + "source": [] | |
1032 | + }, | |
1033 | + { | |
1034 | + "cell_type": "code", | |
1035 | + "execution_count": null, | |
1036 | + "id": "f75e538b", | |
1037 | + "metadata": {}, | |
1038 | + "outputs": [], | |
1039 | + "source": [] | |
1040 | + }, | |
1041 | + { | |
1042 | + "cell_type": "code", | |
1043 | + "execution_count": null, | |
1044 | + "id": "0a7b9318", | |
1045 | + "metadata": {}, | |
1046 | + "outputs": [], | |
1047 | + "source": [] | |
1048 | + } | |
1049 | + ], | |
1050 | + "metadata": { | |
1051 | + "kernelspec": { | |
1052 | + "display_name": "Python 3 (ipykernel)", | |
1053 | + "language": "python", | |
1054 | + "name": "python3" | |
1055 | + }, | |
1056 | + "language_info": { | |
1057 | + "codemirror_mode": { | |
1058 | + "name": "ipython", | |
1059 | + "version": 3 | |
1060 | + }, | |
1061 | + "file_extension": ".py", | |
1062 | + "mimetype": "text/x-python", | |
1063 | + "name": "python", | |
1064 | + "nbconvert_exporter": "python", | |
1065 | + "pygments_lexer": "ipython3", | |
1066 | + "version": "3.9.7" | |
1067 | + } | |
1068 | + }, | |
1069 | + "nbformat": 4, | |
1070 | + "nbformat_minor": 5 | |
1071 | +} |
+++ 20220404/.ipynb_checkpoints/tuple-checkpoint.ipynb
... | ... | @@ -0,0 +1,622 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 33, | |
6 | + "id": "72425bc5", | |
7 | + "metadata": {}, | |
8 | + "outputs": [ | |
9 | + { | |
10 | + "data": { | |
11 | + "text/plain": [ | |
12 | + "(1,)" | |
13 | + ] | |
14 | + }, | |
15 | + "execution_count": 33, | |
16 | + "metadata": {}, | |
17 | + "output_type": "execute_result" | |
18 | + } | |
19 | + ], | |
20 | + "source": [ | |
21 | + "t1 = (1, )\n", | |
22 | + "t1" | |
23 | + ] | |
24 | + }, | |
25 | + { | |
26 | + "cell_type": "code", | |
27 | + "execution_count": 34, | |
28 | + "id": "1b714f42", | |
29 | + "metadata": {}, | |
30 | + "outputs": [ | |
31 | + { | |
32 | + "data": { | |
33 | + "text/plain": [ | |
34 | + "(1, 2, 3)" | |
35 | + ] | |
36 | + }, | |
37 | + "execution_count": 34, | |
38 | + "metadata": {}, | |
39 | + "output_type": "execute_result" | |
40 | + } | |
41 | + ], | |
42 | + "source": [ | |
43 | + "# Tuple Must in '()'\n", | |
44 | + "t2 = (1, 2, 3)\n", | |
45 | + "t3 = 1, 2, 3\n", | |
46 | + "t2\n", | |
47 | + "t3" | |
48 | + ] | |
49 | + }, | |
50 | + { | |
51 | + "cell_type": "code", | |
52 | + "execution_count": 35, | |
53 | + "id": "7102fafb", | |
54 | + "metadata": {}, | |
55 | + "outputs": [ | |
56 | + { | |
57 | + "data": { | |
58 | + "text/plain": [ | |
59 | + "(1, 2, (3, 4), ('Life', 'is'))" | |
60 | + ] | |
61 | + }, | |
62 | + "execution_count": 35, | |
63 | + "metadata": {}, | |
64 | + "output_type": "execute_result" | |
65 | + } | |
66 | + ], | |
67 | + "source": [ | |
68 | + "t4 = (1, 2, (3, 4), ('Life', 'is'))\n", | |
69 | + "t4" | |
70 | + ] | |
71 | + }, | |
72 | + { | |
73 | + "cell_type": "code", | |
74 | + "execution_count": 36, | |
75 | + "id": "7ef38820", | |
76 | + "metadata": {}, | |
77 | + "outputs": [ | |
78 | + { | |
79 | + "data": { | |
80 | + "text/plain": [ | |
81 | + "4" | |
82 | + ] | |
83 | + }, | |
84 | + "execution_count": 36, | |
85 | + "metadata": {}, | |
86 | + "output_type": "execute_result" | |
87 | + } | |
88 | + ], | |
89 | + "source": [ | |
90 | + "t4[2][-1]" | |
91 | + ] | |
92 | + }, | |
93 | + { | |
94 | + "cell_type": "code", | |
95 | + "execution_count": 37, | |
96 | + "id": "13b2d9c0", | |
97 | + "metadata": {}, | |
98 | + "outputs": [ | |
99 | + { | |
100 | + "data": { | |
101 | + "text/plain": [ | |
102 | + "(1, 1, 2, 3)" | |
103 | + ] | |
104 | + }, | |
105 | + "execution_count": 37, | |
106 | + "metadata": {}, | |
107 | + "output_type": "execute_result" | |
108 | + } | |
109 | + ], | |
110 | + "source": [ | |
111 | + "t1 + t2" | |
112 | + ] | |
113 | + }, | |
114 | + { | |
115 | + "cell_type": "code", | |
116 | + "execution_count": 38, | |
117 | + "id": "48625967", | |
118 | + "metadata": {}, | |
119 | + "outputs": [ | |
120 | + { | |
121 | + "data": { | |
122 | + "text/plain": [ | |
123 | + "(1, 2, 3, 1, 2, 3, 1, 2, 3)" | |
124 | + ] | |
125 | + }, | |
126 | + "execution_count": 38, | |
127 | + "metadata": {}, | |
128 | + "output_type": "execute_result" | |
129 | + } | |
130 | + ], | |
131 | + "source": [ | |
132 | + "t2 * 3" | |
133 | + ] | |
134 | + }, | |
135 | + { | |
136 | + "cell_type": "code", | |
137 | + "execution_count": 39, | |
138 | + "id": "c948876e", | |
139 | + "metadata": {}, | |
140 | + "outputs": [ | |
141 | + { | |
142 | + "data": { | |
143 | + "text/plain": [ | |
144 | + "{'name': 'Hong', 'phone': '01012345678', 'birth': '0814'}" | |
145 | + ] | |
146 | + }, | |
147 | + "execution_count": 39, | |
148 | + "metadata": {}, | |
149 | + "output_type": "execute_result" | |
150 | + } | |
151 | + ], | |
152 | + "source": [ | |
153 | + "dic = {'name':'Hong', 'phone':'01012345678', 'birth':'0814'}\n", | |
154 | + "dic" | |
155 | + ] | |
156 | + }, | |
157 | + { | |
158 | + "cell_type": "code", | |
159 | + "execution_count": 40, | |
160 | + "id": "24a5d503", | |
161 | + "metadata": {}, | |
162 | + "outputs": [ | |
163 | + { | |
164 | + "data": { | |
165 | + "text/plain": [ | |
166 | + "'Hong'" | |
167 | + ] | |
168 | + }, | |
169 | + "execution_count": 40, | |
170 | + "metadata": {}, | |
171 | + "output_type": "execute_result" | |
172 | + } | |
173 | + ], | |
174 | + "source": [ | |
175 | + "dic['name']" | |
176 | + ] | |
177 | + }, | |
178 | + { | |
179 | + "cell_type": "code", | |
180 | + "execution_count": 41, | |
181 | + "id": "5209ec19", | |
182 | + "metadata": {}, | |
183 | + "outputs": [ | |
184 | + { | |
185 | + "data": { | |
186 | + "text/plain": [ | |
187 | + "'01012345678'" | |
188 | + ] | |
189 | + }, | |
190 | + "execution_count": 41, | |
191 | + "metadata": {}, | |
192 | + "output_type": "execute_result" | |
193 | + } | |
194 | + ], | |
195 | + "source": [ | |
196 | + "dic['phone']" | |
197 | + ] | |
198 | + }, | |
199 | + { | |
200 | + "cell_type": "code", | |
201 | + "execution_count": 42, | |
202 | + "id": "8c66ad44", | |
203 | + "metadata": {}, | |
204 | + "outputs": [ | |
205 | + { | |
206 | + "data": { | |
207 | + "text/plain": [ | |
208 | + "'0814'" | |
209 | + ] | |
210 | + }, | |
211 | + "execution_count": 42, | |
212 | + "metadata": {}, | |
213 | + "output_type": "execute_result" | |
214 | + } | |
215 | + ], | |
216 | + "source": [ | |
217 | + "dic['birth']" | |
218 | + ] | |
219 | + }, | |
220 | + { | |
221 | + "cell_type": "code", | |
222 | + "execution_count": 43, | |
223 | + "id": "d75ac067", | |
224 | + "metadata": {}, | |
225 | + "outputs": [ | |
226 | + { | |
227 | + "data": { | |
228 | + "text/plain": [ | |
229 | + "{'name': 'Hong', 'phone': '01012345678', 'birth': '0814', 1: 'a'}" | |
230 | + ] | |
231 | + }, | |
232 | + "execution_count": 43, | |
233 | + "metadata": {}, | |
234 | + "output_type": "execute_result" | |
235 | + } | |
236 | + ], | |
237 | + "source": [ | |
238 | + "dic[1] = 'a'\n", | |
239 | + "dic" | |
240 | + ] | |
241 | + }, | |
242 | + { | |
243 | + "cell_type": "code", | |
244 | + "execution_count": 44, | |
245 | + "id": "1c9a62b8", | |
246 | + "metadata": {}, | |
247 | + "outputs": [], | |
248 | + "source": [ | |
249 | + "dic['pet'] = 'dog'" | |
250 | + ] | |
251 | + }, | |
252 | + { | |
253 | + "cell_type": "code", | |
254 | + "execution_count": 45, | |
255 | + "id": "28e960d9", | |
256 | + "metadata": {}, | |
257 | + "outputs": [ | |
258 | + { | |
259 | + "data": { | |
260 | + "text/plain": [ | |
261 | + "{'name': 'Hong', 'phone': '01012345678', 'birth': '0814', 1: 'a', 'pet': 'dog'}" | |
262 | + ] | |
263 | + }, | |
264 | + "execution_count": 45, | |
265 | + "metadata": {}, | |
266 | + "output_type": "execute_result" | |
267 | + } | |
268 | + ], | |
269 | + "source": [ | |
270 | + "dic" | |
271 | + ] | |
272 | + }, | |
273 | + { | |
274 | + "cell_type": "code", | |
275 | + "execution_count": 46, | |
276 | + "id": "94836ccf", | |
277 | + "metadata": {}, | |
278 | + "outputs": [ | |
279 | + { | |
280 | + "data": { | |
281 | + "text/plain": [ | |
282 | + "{'name': 'Hong', 'phone': '01012345678', 'birth': '0814', 'pet': 'dog'}" | |
283 | + ] | |
284 | + }, | |
285 | + "execution_count": 46, | |
286 | + "metadata": {}, | |
287 | + "output_type": "execute_result" | |
288 | + } | |
289 | + ], | |
290 | + "source": [ | |
291 | + "del dic[1]\n", | |
292 | + "dic" | |
293 | + ] | |
294 | + }, | |
295 | + { | |
296 | + "cell_type": "code", | |
297 | + "execution_count": 47, | |
298 | + "id": "9d650023", | |
299 | + "metadata": {}, | |
300 | + "outputs": [ | |
301 | + { | |
302 | + "data": { | |
303 | + "text/plain": [ | |
304 | + "dict_keys(['name', 'phone', 'birth', 'pet'])" | |
305 | + ] | |
306 | + }, | |
307 | + "execution_count": 47, | |
308 | + "metadata": {}, | |
309 | + "output_type": "execute_result" | |
310 | + } | |
311 | + ], | |
312 | + "source": [ | |
313 | + "dic.keys()" | |
314 | + ] | |
315 | + }, | |
316 | + { | |
317 | + "cell_type": "code", | |
318 | + "execution_count": 48, | |
319 | + "id": "979161a7", | |
320 | + "metadata": {}, | |
321 | + "outputs": [ | |
322 | + { | |
323 | + "data": { | |
324 | + "text/plain": [ | |
325 | + "['name', 'phone', 'birth', 'pet']" | |
326 | + ] | |
327 | + }, | |
328 | + "execution_count": 48, | |
329 | + "metadata": {}, | |
330 | + "output_type": "execute_result" | |
331 | + } | |
332 | + ], | |
333 | + "source": [ | |
334 | + "list(dic.keys())" | |
335 | + ] | |
336 | + }, | |
337 | + { | |
338 | + "cell_type": "code", | |
339 | + "execution_count": 49, | |
340 | + "id": "ebb6e9e3", | |
341 | + "metadata": {}, | |
342 | + "outputs": [ | |
343 | + { | |
344 | + "data": { | |
345 | + "text/plain": [ | |
346 | + "dict_values(['Hong', '01012345678', '0814', 'dog'])" | |
347 | + ] | |
348 | + }, | |
349 | + "execution_count": 49, | |
350 | + "metadata": {}, | |
351 | + "output_type": "execute_result" | |
352 | + } | |
353 | + ], | |
354 | + "source": [ | |
355 | + "dic.values()" | |
356 | + ] | |
357 | + }, | |
358 | + { | |
359 | + "cell_type": "code", | |
360 | + "execution_count": 50, | |
361 | + "id": "d0d7892b", | |
362 | + "metadata": {}, | |
363 | + "outputs": [ | |
364 | + { | |
365 | + "data": { | |
366 | + "text/plain": [ | |
367 | + "['Hong', '01012345678', '0814', 'dog']" | |
368 | + ] | |
369 | + }, | |
370 | + "execution_count": 50, | |
371 | + "metadata": {}, | |
372 | + "output_type": "execute_result" | |
373 | + } | |
374 | + ], | |
375 | + "source": [ | |
376 | + "list(dic.values())" | |
377 | + ] | |
378 | + }, | |
379 | + { | |
380 | + "cell_type": "code", | |
381 | + "execution_count": 51, | |
382 | + "id": "a9001930", | |
383 | + "metadata": {}, | |
384 | + "outputs": [ | |
385 | + { | |
386 | + "data": { | |
387 | + "text/plain": [ | |
388 | + "dict_items([('name', 'Hong'), ('phone', '01012345678'), ('birth', '0814'), ('pet', 'dog')])" | |
389 | + ] | |
390 | + }, | |
391 | + "execution_count": 51, | |
392 | + "metadata": {}, | |
393 | + "output_type": "execute_result" | |
394 | + } | |
395 | + ], | |
396 | + "source": [ | |
397 | + "dic.items()" | |
398 | + ] | |
399 | + }, | |
400 | + { | |
401 | + "cell_type": "code", | |
402 | + "execution_count": 52, | |
403 | + "id": "4e542b31", | |
404 | + "metadata": {}, | |
405 | + "outputs": [], | |
406 | + "source": [ | |
407 | + "dic[4] = 'b'" | |
408 | + ] | |
409 | + }, | |
410 | + { | |
411 | + "cell_type": "code", | |
412 | + "execution_count": 53, | |
413 | + "id": "b5498318", | |
414 | + "metadata": {}, | |
415 | + "outputs": [ | |
416 | + { | |
417 | + "data": { | |
418 | + "text/plain": [ | |
419 | + "{'name': 'Hong', 'phone': '01012345678', 'birth': '0814', 'pet': 'dog', 4: 'b'}" | |
420 | + ] | |
421 | + }, | |
422 | + "execution_count": 53, | |
423 | + "metadata": {}, | |
424 | + "output_type": "execute_result" | |
425 | + } | |
426 | + ], | |
427 | + "source": [ | |
428 | + "dic" | |
429 | + ] | |
430 | + }, | |
431 | + { | |
432 | + "cell_type": "code", | |
433 | + "execution_count": 54, | |
434 | + "id": "fe6c03cf", | |
435 | + "metadata": {}, | |
436 | + "outputs": [], | |
437 | + "source": [ | |
438 | + "dic[1] = 'a'" | |
439 | + ] | |
440 | + }, | |
441 | + { | |
442 | + "cell_type": "code", | |
443 | + "execution_count": 55, | |
444 | + "id": "993e32a4", | |
445 | + "metadata": {}, | |
446 | + "outputs": [ | |
447 | + { | |
448 | + "data": { | |
449 | + "text/plain": [ | |
450 | + "{'name': 'Hong',\n", | |
451 | + " 'phone': '01012345678',\n", | |
452 | + " 'birth': '0814',\n", | |
453 | + " 'pet': 'dog',\n", | |
454 | + " 4: 'b',\n", | |
455 | + " 1: 'a'}" | |
456 | + ] | |
457 | + }, | |
458 | + "execution_count": 55, | |
459 | + "metadata": {}, | |
460 | + "output_type": "execute_result" | |
461 | + } | |
462 | + ], | |
463 | + "source": [ | |
464 | + "dic" | |
465 | + ] | |
466 | + }, | |
467 | + { | |
468 | + "cell_type": "code", | |
469 | + "execution_count": 56, | |
470 | + "id": "dd837c27", | |
471 | + "metadata": {}, | |
472 | + "outputs": [], | |
473 | + "source": [ | |
474 | + "dic['area'] = 'kr'" | |
475 | + ] | |
476 | + }, | |
477 | + { | |
478 | + "cell_type": "code", | |
479 | + "execution_count": 57, | |
480 | + "id": "ca182035", | |
481 | + "metadata": {}, | |
482 | + "outputs": [ | |
483 | + { | |
484 | + "data": { | |
485 | + "text/plain": [ | |
486 | + "{'name': 'Hong',\n", | |
487 | + " 'phone': '01012345678',\n", | |
488 | + " 'birth': '0814',\n", | |
489 | + " 'pet': 'dog',\n", | |
490 | + " 4: 'b',\n", | |
491 | + " 1: 'a',\n", | |
492 | + " 'area': 'kr'}" | |
493 | + ] | |
494 | + }, | |
495 | + "execution_count": 57, | |
496 | + "metadata": {}, | |
497 | + "output_type": "execute_result" | |
498 | + } | |
499 | + ], | |
500 | + "source": [ | |
501 | + "dic" | |
502 | + ] | |
503 | + }, | |
504 | + { | |
505 | + "cell_type": "code", | |
506 | + "execution_count": null, | |
507 | + "id": "caeedcc4", | |
508 | + "metadata": {}, | |
509 | + "outputs": [], | |
510 | + "source": [] | |
511 | + }, | |
512 | + { | |
513 | + "cell_type": "code", | |
514 | + "execution_count": null, | |
515 | + "id": "c4a84a53", | |
516 | + "metadata": {}, | |
517 | + "outputs": [], | |
518 | + "source": [] | |
519 | + }, | |
520 | + { | |
521 | + "cell_type": "code", | |
522 | + "execution_count": null, | |
523 | + "id": "ae7cd89b", | |
524 | + "metadata": {}, | |
525 | + "outputs": [], | |
526 | + "source": [] | |
527 | + }, | |
528 | + { | |
529 | + "cell_type": "code", | |
530 | + "execution_count": null, | |
531 | + "id": "dade6dc3", | |
532 | + "metadata": {}, | |
533 | + "outputs": [], | |
534 | + "source": [] | |
535 | + }, | |
536 | + { | |
537 | + "cell_type": "code", | |
538 | + "execution_count": null, | |
539 | + "id": "bebcd6c7", | |
540 | + "metadata": {}, | |
541 | + "outputs": [], | |
542 | + "source": [] | |
543 | + }, | |
544 | + { | |
545 | + "cell_type": "code", | |
546 | + "execution_count": null, | |
547 | + "id": "d47497b4", | |
548 | + "metadata": {}, | |
549 | + "outputs": [], | |
550 | + "source": [] | |
551 | + }, | |
552 | + { | |
553 | + "cell_type": "code", | |
554 | + "execution_count": null, | |
555 | + "id": "1253420a", | |
556 | + "metadata": {}, | |
557 | + "outputs": [], | |
558 | + "source": [] | |
559 | + }, | |
560 | + { | |
561 | + "cell_type": "code", | |
562 | + "execution_count": null, | |
563 | + "id": "b2a2618f", | |
564 | + "metadata": {}, | |
565 | + "outputs": [], | |
566 | + "source": [] | |
567 | + }, | |
568 | + { | |
569 | + "cell_type": "code", | |
570 | + "execution_count": null, | |
571 | + "id": "32ba3a15", | |
572 | + "metadata": {}, | |
573 | + "outputs": [], | |
574 | + "source": [] | |
575 | + }, | |
576 | + { | |
577 | + "cell_type": "code", | |
578 | + "execution_count": null, | |
579 | + "id": "2f5a27b1", | |
580 | + "metadata": {}, | |
581 | + "outputs": [], | |
582 | + "source": [] | |
583 | + }, | |
584 | + { | |
585 | + "cell_type": "code", | |
586 | + "execution_count": null, | |
587 | + "id": "eb7fbfb7", | |
588 | + "metadata": {}, | |
589 | + "outputs": [], | |
590 | + "source": [] | |
591 | + }, | |
592 | + { | |
593 | + "cell_type": "code", | |
594 | + "execution_count": null, | |
595 | + "id": "e76d80c4", | |
596 | + "metadata": {}, | |
597 | + "outputs": [], | |
598 | + "source": [] | |
599 | + } | |
600 | + ], | |
601 | + "metadata": { | |
602 | + "kernelspec": { | |
603 | + "display_name": "Python 3 (ipykernel)", | |
604 | + "language": "python", | |
605 | + "name": "python3" | |
606 | + }, | |
607 | + "language_info": { | |
608 | + "codemirror_mode": { | |
609 | + "name": "ipython", | |
610 | + "version": 3 | |
611 | + }, | |
612 | + "file_extension": ".py", | |
613 | + "mimetype": "text/x-python", | |
614 | + "name": "python", | |
615 | + "nbconvert_exporter": "python", | |
616 | + "pygments_lexer": "ipython3", | |
617 | + "version": "3.9.7" | |
618 | + } | |
619 | + }, | |
620 | + "nbformat": 4, | |
621 | + "nbformat_minor": 5 | |
622 | +} |
+++ 20220404/list.ipynb
... | ... | @@ -0,0 +1,1071 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 27, | |
6 | + "id": "8cde316d", | |
7 | + "metadata": {}, | |
8 | + "outputs": [ | |
9 | + { | |
10 | + "data": { | |
11 | + "text/plain": [ | |
12 | + "[1, 2, 3]" | |
13 | + ] | |
14 | + }, | |
15 | + "execution_count": 27, | |
16 | + "metadata": {}, | |
17 | + "output_type": "execute_result" | |
18 | + } | |
19 | + ], | |
20 | + "source": [ | |
21 | + "a = [1, 2, 3]\n", | |
22 | + "a" | |
23 | + ] | |
24 | + }, | |
25 | + { | |
26 | + "cell_type": "code", | |
27 | + "execution_count": 28, | |
28 | + "id": "31a658b6", | |
29 | + "metadata": {}, | |
30 | + "outputs": [ | |
31 | + { | |
32 | + "data": { | |
33 | + "text/plain": [ | |
34 | + "['Life', ' is', 'too', 'short']" | |
35 | + ] | |
36 | + }, | |
37 | + "execution_count": 28, | |
38 | + "metadata": {}, | |
39 | + "output_type": "execute_result" | |
40 | + } | |
41 | + ], | |
42 | + "source": [ | |
43 | + "b = [\"Life\", \" is\", \"too\", \"short\"]\n", | |
44 | + "b" | |
45 | + ] | |
46 | + }, | |
47 | + { | |
48 | + "cell_type": "code", | |
49 | + "execution_count": 29, | |
50 | + "id": "af028ec4", | |
51 | + "metadata": {}, | |
52 | + "outputs": [ | |
53 | + { | |
54 | + "data": { | |
55 | + "text/plain": [ | |
56 | + "[1, 2, 'Life', 'is']" | |
57 | + ] | |
58 | + }, | |
59 | + "execution_count": 29, | |
60 | + "metadata": {}, | |
61 | + "output_type": "execute_result" | |
62 | + } | |
63 | + ], | |
64 | + "source": [ | |
65 | + "c = [1, 2, \"Life\", \"is\"]\n", | |
66 | + "c" | |
67 | + ] | |
68 | + }, | |
69 | + { | |
70 | + "cell_type": "code", | |
71 | + "execution_count": 30, | |
72 | + "id": "aed75dc2", | |
73 | + "metadata": {}, | |
74 | + "outputs": [ | |
75 | + { | |
76 | + "data": { | |
77 | + "text/plain": [ | |
78 | + "[1, 2, [3, 4], ['Life', 'is']]" | |
79 | + ] | |
80 | + }, | |
81 | + "execution_count": 30, | |
82 | + "metadata": {}, | |
83 | + "output_type": "execute_result" | |
84 | + } | |
85 | + ], | |
86 | + "source": [ | |
87 | + "d = [1, 2, [3, 4], [\"Life\", \"is\"]]\n", | |
88 | + "d" | |
89 | + ] | |
90 | + }, | |
91 | + { | |
92 | + "cell_type": "code", | |
93 | + "execution_count": 32, | |
94 | + "id": "b9d56702", | |
95 | + "metadata": { | |
96 | + "collapsed": true | |
97 | + }, | |
98 | + "outputs": [ | |
99 | + { | |
100 | + "data": { | |
101 | + "text/plain": [ | |
102 | + "2" | |
103 | + ] | |
104 | + }, | |
105 | + "execution_count": 32, | |
106 | + "metadata": {}, | |
107 | + "output_type": "execute_result" | |
108 | + } | |
109 | + ], | |
110 | + "source": [ | |
111 | + "a[1]" | |
112 | + ] | |
113 | + }, | |
114 | + { | |
115 | + "cell_type": "code", | |
116 | + "execution_count": 33, | |
117 | + "id": "2fdf5bdd", | |
118 | + "metadata": { | |
119 | + "collapsed": true | |
120 | + }, | |
121 | + "outputs": [ | |
122 | + { | |
123 | + "data": { | |
124 | + "text/plain": [ | |
125 | + "'short'" | |
126 | + ] | |
127 | + }, | |
128 | + "execution_count": 33, | |
129 | + "metadata": {}, | |
130 | + "output_type": "execute_result" | |
131 | + } | |
132 | + ], | |
133 | + "source": [ | |
134 | + "b[-1]" | |
135 | + ] | |
136 | + }, | |
137 | + { | |
138 | + "cell_type": "code", | |
139 | + "execution_count": 37, | |
140 | + "id": "a1e6399b", | |
141 | + "metadata": { | |
142 | + "collapsed": true | |
143 | + }, | |
144 | + "outputs": [ | |
145 | + { | |
146 | + "data": { | |
147 | + "text/plain": [ | |
148 | + "4" | |
149 | + ] | |
150 | + }, | |
151 | + "execution_count": 37, | |
152 | + "metadata": {}, | |
153 | + "output_type": "execute_result" | |
154 | + } | |
155 | + ], | |
156 | + "source": [ | |
157 | + "d[2][-1]" | |
158 | + ] | |
159 | + }, | |
160 | + { | |
161 | + "cell_type": "code", | |
162 | + "execution_count": 40, | |
163 | + "id": "698645c1", | |
164 | + "metadata": { | |
165 | + "collapsed": true | |
166 | + }, | |
167 | + "outputs": [ | |
168 | + { | |
169 | + "data": { | |
170 | + "text/plain": [ | |
171 | + "['Life', 'is']" | |
172 | + ] | |
173 | + }, | |
174 | + "execution_count": 40, | |
175 | + "metadata": {}, | |
176 | + "output_type": "execute_result" | |
177 | + } | |
178 | + ], | |
179 | + "source": [ | |
180 | + "d[-1]" | |
181 | + ] | |
182 | + }, | |
183 | + { | |
184 | + "cell_type": "code", | |
185 | + "execution_count": 43, | |
186 | + "id": "9a0e2d6f", | |
187 | + "metadata": { | |
188 | + "collapsed": true | |
189 | + }, | |
190 | + "outputs": [ | |
191 | + { | |
192 | + "data": { | |
193 | + "text/plain": [ | |
194 | + "'Life'" | |
195 | + ] | |
196 | + }, | |
197 | + "execution_count": 43, | |
198 | + "metadata": {}, | |
199 | + "output_type": "execute_result" | |
200 | + } | |
201 | + ], | |
202 | + "source": [ | |
203 | + "d[-1][-2]" | |
204 | + ] | |
205 | + }, | |
206 | + { | |
207 | + "cell_type": "code", | |
208 | + "execution_count": 44, | |
209 | + "id": "f557f756", | |
210 | + "metadata": { | |
211 | + "collapsed": true | |
212 | + }, | |
213 | + "outputs": [ | |
214 | + { | |
215 | + "data": { | |
216 | + "text/plain": [ | |
217 | + "[1, 2, [3, 4]]" | |
218 | + ] | |
219 | + }, | |
220 | + "execution_count": 44, | |
221 | + "metadata": {}, | |
222 | + "output_type": "execute_result" | |
223 | + } | |
224 | + ], | |
225 | + "source": [ | |
226 | + "d[0:3]" | |
227 | + ] | |
228 | + }, | |
229 | + { | |
230 | + "cell_type": "code", | |
231 | + "execution_count": 46, | |
232 | + "id": "313e2152", | |
233 | + "metadata": {}, | |
234 | + "outputs": [ | |
235 | + { | |
236 | + "data": { | |
237 | + "text/plain": [ | |
238 | + "[1, 2, 3, 'Life', ' is', 'too', 'short']" | |
239 | + ] | |
240 | + }, | |
241 | + "execution_count": 46, | |
242 | + "metadata": {}, | |
243 | + "output_type": "execute_result" | |
244 | + } | |
245 | + ], | |
246 | + "source": [ | |
247 | + "a+b" | |
248 | + ] | |
249 | + }, | |
250 | + { | |
251 | + "cell_type": "code", | |
252 | + "execution_count": 49, | |
253 | + "id": "9959a5e2", | |
254 | + "metadata": {}, | |
255 | + "outputs": [ | |
256 | + { | |
257 | + "data": { | |
258 | + "text/plain": [ | |
259 | + "'Life'" | |
260 | + ] | |
261 | + }, | |
262 | + "execution_count": 49, | |
263 | + "metadata": {}, | |
264 | + "output_type": "execute_result" | |
265 | + } | |
266 | + ], | |
267 | + "source": [ | |
268 | + "b[0]" | |
269 | + ] | |
270 | + }, | |
271 | + { | |
272 | + "cell_type": "code", | |
273 | + "execution_count": 53, | |
274 | + "id": "0ead5b30", | |
275 | + "metadata": {}, | |
276 | + "outputs": [ | |
277 | + { | |
278 | + "data": { | |
279 | + "text/plain": [ | |
280 | + "'1hi ~^^`'" | |
281 | + ] | |
282 | + }, | |
283 | + "execution_count": 53, | |
284 | + "metadata": {}, | |
285 | + "output_type": "execute_result" | |
286 | + } | |
287 | + ], | |
288 | + "source": [ | |
289 | + "str(a[0]) + \"hi ~^^`\"" | |
290 | + ] | |
291 | + }, | |
292 | + { | |
293 | + "cell_type": "code", | |
294 | + "execution_count": 54, | |
295 | + "id": "c574311e", | |
296 | + "metadata": {}, | |
297 | + "outputs": [ | |
298 | + { | |
299 | + "data": { | |
300 | + "text/plain": [ | |
301 | + "[1, 2, 3]" | |
302 | + ] | |
303 | + }, | |
304 | + "execution_count": 54, | |
305 | + "metadata": {}, | |
306 | + "output_type": "execute_result" | |
307 | + } | |
308 | + ], | |
309 | + "source": [ | |
310 | + "a" | |
311 | + ] | |
312 | + }, | |
313 | + { | |
314 | + "cell_type": "code", | |
315 | + "execution_count": 61, | |
316 | + "id": "5430555e", | |
317 | + "metadata": {}, | |
318 | + "outputs": [ | |
319 | + { | |
320 | + "data": { | |
321 | + "text/plain": [ | |
322 | + "3" | |
323 | + ] | |
324 | + }, | |
325 | + "execution_count": 61, | |
326 | + "metadata": {}, | |
327 | + "output_type": "execute_result" | |
328 | + } | |
329 | + ], | |
330 | + "source": [ | |
331 | + "int('1') + int('2')" | |
332 | + ] | |
333 | + }, | |
334 | + { | |
335 | + "cell_type": "code", | |
336 | + "execution_count": 62, | |
337 | + "id": "4e293d6c", | |
338 | + "metadata": {}, | |
339 | + "outputs": [ | |
340 | + { | |
341 | + "data": { | |
342 | + "text/plain": [ | |
343 | + "[1, 2, 3, 1, 2, 3, 1, 2, 3]" | |
344 | + ] | |
345 | + }, | |
346 | + "execution_count": 62, | |
347 | + "metadata": {}, | |
348 | + "output_type": "execute_result" | |
349 | + } | |
350 | + ], | |
351 | + "source": [ | |
352 | + "a * 3" | |
353 | + ] | |
354 | + }, | |
355 | + { | |
356 | + "cell_type": "code", | |
357 | + "execution_count": 63, | |
358 | + "id": "4a7633f8", | |
359 | + "metadata": {}, | |
360 | + "outputs": [], | |
361 | + "source": [ | |
362 | + "del a[0]" | |
363 | + ] | |
364 | + }, | |
365 | + { | |
366 | + "cell_type": "code", | |
367 | + "execution_count": 66, | |
368 | + "id": "8e38fefe", | |
369 | + "metadata": {}, | |
370 | + "outputs": [], | |
371 | + "source": [ | |
372 | + "a.insert(0, a)" | |
373 | + ] | |
374 | + }, | |
375 | + { | |
376 | + "cell_type": "code", | |
377 | + "execution_count": 69, | |
378 | + "id": "82628ba6", | |
379 | + "metadata": {}, | |
380 | + "outputs": [], | |
381 | + "source": [ | |
382 | + "del a[1]" | |
383 | + ] | |
384 | + }, | |
385 | + { | |
386 | + "cell_type": "code", | |
387 | + "execution_count": 70, | |
388 | + "id": "de133692", | |
389 | + "metadata": {}, | |
390 | + "outputs": [ | |
391 | + { | |
392 | + "data": { | |
393 | + "text/plain": [ | |
394 | + "[[...], 3]" | |
395 | + ] | |
396 | + }, | |
397 | + "execution_count": 70, | |
398 | + "metadata": {}, | |
399 | + "output_type": "execute_result" | |
400 | + } | |
401 | + ], | |
402 | + "source": [ | |
403 | + "a" | |
404 | + ] | |
405 | + }, | |
406 | + { | |
407 | + "cell_type": "code", | |
408 | + "execution_count": 72, | |
409 | + "id": "240e416a", | |
410 | + "metadata": {}, | |
411 | + "outputs": [ | |
412 | + { | |
413 | + "data": { | |
414 | + "text/plain": [ | |
415 | + "[]" | |
416 | + ] | |
417 | + }, | |
418 | + "execution_count": 72, | |
419 | + "metadata": {}, | |
420 | + "output_type": "execute_result" | |
421 | + } | |
422 | + ], | |
423 | + "source": [ | |
424 | + "del a[0]\n", | |
425 | + "a" | |
426 | + ] | |
427 | + }, | |
428 | + { | |
429 | + "cell_type": "code", | |
430 | + "execution_count": 73, | |
431 | + "id": "1326585c", | |
432 | + "metadata": {}, | |
433 | + "outputs": [], | |
434 | + "source": [ | |
435 | + "a = [1, 2, 3]" | |
436 | + ] | |
437 | + }, | |
438 | + { | |
439 | + "cell_type": "code", | |
440 | + "execution_count": 74, | |
441 | + "id": "0ef8d1be", | |
442 | + "metadata": {}, | |
443 | + "outputs": [ | |
444 | + { | |
445 | + "data": { | |
446 | + "text/plain": [ | |
447 | + "[1, 2, 3]" | |
448 | + ] | |
449 | + }, | |
450 | + "execution_count": 74, | |
451 | + "metadata": {}, | |
452 | + "output_type": "execute_result" | |
453 | + } | |
454 | + ], | |
455 | + "source": [ | |
456 | + "a" | |
457 | + ] | |
458 | + }, | |
459 | + { | |
460 | + "cell_type": "code", | |
461 | + "execution_count": 76, | |
462 | + "id": "5164f42d", | |
463 | + "metadata": {}, | |
464 | + "outputs": [ | |
465 | + { | |
466 | + "data": { | |
467 | + "text/plain": [ | |
468 | + "['a', 'b', 'c']" | |
469 | + ] | |
470 | + }, | |
471 | + "execution_count": 76, | |
472 | + "metadata": {}, | |
473 | + "output_type": "execute_result" | |
474 | + } | |
475 | + ], | |
476 | + "source": [ | |
477 | + "aa = ['a', 'b', 'c']\n", | |
478 | + "aa" | |
479 | + ] | |
480 | + }, | |
481 | + { | |
482 | + "cell_type": "code", | |
483 | + "execution_count": 79, | |
484 | + "id": "e2e38fff", | |
485 | + "metadata": {}, | |
486 | + "outputs": [ | |
487 | + { | |
488 | + "data": { | |
489 | + "text/plain": [ | |
490 | + "['a', 'b', 'd']" | |
491 | + ] | |
492 | + }, | |
493 | + "execution_count": 79, | |
494 | + "metadata": {}, | |
495 | + "output_type": "execute_result" | |
496 | + } | |
497 | + ], | |
498 | + "source": [ | |
499 | + "aa[2] = 'd'\n", | |
500 | + "aa" | |
501 | + ] | |
502 | + }, | |
503 | + { | |
504 | + "cell_type": "code", | |
505 | + "execution_count": 84, | |
506 | + "id": "314b0a27", | |
507 | + "metadata": {}, | |
508 | + "outputs": [ | |
509 | + { | |
510 | + "data": { | |
511 | + "text/plain": [ | |
512 | + "['a', ['x', 'y', 'z'], 'd']" | |
513 | + ] | |
514 | + }, | |
515 | + "execution_count": 84, | |
516 | + "metadata": {}, | |
517 | + "output_type": "execute_result" | |
518 | + } | |
519 | + ], | |
520 | + "source": [ | |
521 | + "aa[1] = ['x', 'y', 'z']\n", | |
522 | + "aa" | |
523 | + ] | |
524 | + }, | |
525 | + { | |
526 | + "cell_type": "code", | |
527 | + "execution_count": 86, | |
528 | + "id": "0037cf3e", | |
529 | + "metadata": {}, | |
530 | + "outputs": [ | |
531 | + { | |
532 | + "data": { | |
533 | + "text/plain": [ | |
534 | + "[1, 2, 99]" | |
535 | + ] | |
536 | + }, | |
537 | + "execution_count": 86, | |
538 | + "metadata": {}, | |
539 | + "output_type": "execute_result" | |
540 | + } | |
541 | + ], | |
542 | + "source": [ | |
543 | + "a[-1] = 99\n", | |
544 | + "a" | |
545 | + ] | |
546 | + }, | |
547 | + { | |
548 | + "cell_type": "code", | |
549 | + "execution_count": 87, | |
550 | + "id": "d64845b1", | |
551 | + "metadata": {}, | |
552 | + "outputs": [], | |
553 | + "source": [ | |
554 | + "a[1:2] = ['a', 'b', 'c']" | |
555 | + ] | |
556 | + }, | |
557 | + { | |
558 | + "cell_type": "code", | |
559 | + "execution_count": 88, | |
560 | + "id": "1aae50c5", | |
561 | + "metadata": {}, | |
562 | + "outputs": [ | |
563 | + { | |
564 | + "data": { | |
565 | + "text/plain": [ | |
566 | + "[1, 'a', 'b', 'c', 99]" | |
567 | + ] | |
568 | + }, | |
569 | + "execution_count": 88, | |
570 | + "metadata": {}, | |
571 | + "output_type": "execute_result" | |
572 | + } | |
573 | + ], | |
574 | + "source": [ | |
575 | + "a" | |
576 | + ] | |
577 | + }, | |
578 | + { | |
579 | + "cell_type": "code", | |
580 | + "execution_count": 89, | |
581 | + "id": "e23db83f", | |
582 | + "metadata": {}, | |
583 | + "outputs": [ | |
584 | + { | |
585 | + "data": { | |
586 | + "text/plain": [ | |
587 | + "[1, 'a', 'b', 'c', ['d', 'e', 'f']]" | |
588 | + ] | |
589 | + }, | |
590 | + "execution_count": 89, | |
591 | + "metadata": {}, | |
592 | + "output_type": "execute_result" | |
593 | + } | |
594 | + ], | |
595 | + "source": [ | |
596 | + "a[-1] = ['d', 'e', 'f']\n", | |
597 | + "a" | |
598 | + ] | |
599 | + }, | |
600 | + { | |
601 | + "cell_type": "code", | |
602 | + "execution_count": 90, | |
603 | + "id": "5d5242e4", | |
604 | + "metadata": {}, | |
605 | + "outputs": [ | |
606 | + { | |
607 | + "data": { | |
608 | + "text/plain": [ | |
609 | + "[1, 'a', 'b', 'c']" | |
610 | + ] | |
611 | + }, | |
612 | + "execution_count": 90, | |
613 | + "metadata": {}, | |
614 | + "output_type": "execute_result" | |
615 | + } | |
616 | + ], | |
617 | + "source": [ | |
618 | + "del a[-1]\n", | |
619 | + "a" | |
620 | + ] | |
621 | + }, | |
622 | + { | |
623 | + "cell_type": "code", | |
624 | + "execution_count": 91, | |
625 | + "id": "5bac08af", | |
626 | + "metadata": {}, | |
627 | + "outputs": [ | |
628 | + { | |
629 | + "data": { | |
630 | + "text/plain": [ | |
631 | + "[1, 'a', 'b', 'c', 5]" | |
632 | + ] | |
633 | + }, | |
634 | + "execution_count": 91, | |
635 | + "metadata": {}, | |
636 | + "output_type": "execute_result" | |
637 | + } | |
638 | + ], | |
639 | + "source": [ | |
640 | + "a.append(5)\n", | |
641 | + "a" | |
642 | + ] | |
643 | + }, | |
644 | + { | |
645 | + "cell_type": "code", | |
646 | + "execution_count": 95, | |
647 | + "id": "168ece29", | |
648 | + "metadata": { | |
649 | + "scrolled": true | |
650 | + }, | |
651 | + "outputs": [ | |
652 | + { | |
653 | + "data": { | |
654 | + "text/plain": [ | |
655 | + "['__add__',\n", | |
656 | + " '__class__',\n", | |
657 | + " '__class_getitem__',\n", | |
658 | + " '__contains__',\n", | |
659 | + " '__delattr__',\n", | |
660 | + " '__delitem__',\n", | |
661 | + " '__dir__',\n", | |
662 | + " '__doc__',\n", | |
663 | + " '__eq__',\n", | |
664 | + " '__format__',\n", | |
665 | + " '__ge__',\n", | |
666 | + " '__getattribute__',\n", | |
667 | + " '__getitem__',\n", | |
668 | + " '__gt__',\n", | |
669 | + " '__hash__',\n", | |
670 | + " '__iadd__',\n", | |
671 | + " '__imul__',\n", | |
672 | + " '__init__',\n", | |
673 | + " '__init_subclass__',\n", | |
674 | + " '__iter__',\n", | |
675 | + " '__le__',\n", | |
676 | + " '__len__',\n", | |
677 | + " '__lt__',\n", | |
678 | + " '__mul__',\n", | |
679 | + " '__ne__',\n", | |
680 | + " '__new__',\n", | |
681 | + " '__reduce__',\n", | |
682 | + " '__reduce_ex__',\n", | |
683 | + " '__repr__',\n", | |
684 | + " '__reversed__',\n", | |
685 | + " '__rmul__',\n", | |
686 | + " '__setattr__',\n", | |
687 | + " '__setitem__',\n", | |
688 | + " '__sizeof__',\n", | |
689 | + " '__str__',\n", | |
690 | + " '__subclasshook__',\n", | |
691 | + " 'append',\n", | |
692 | + " 'clear',\n", | |
693 | + " 'copy',\n", | |
694 | + " 'count',\n", | |
695 | + " 'extend',\n", | |
696 | + " 'index',\n", | |
697 | + " 'insert',\n", | |
698 | + " 'pop',\n", | |
699 | + " 'remove',\n", | |
700 | + " 'reverse',\n", | |
701 | + " 'sort']" | |
702 | + ] | |
703 | + }, | |
704 | + "execution_count": 95, | |
705 | + "metadata": {}, | |
706 | + "output_type": "execute_result" | |
707 | + } | |
708 | + ], | |
709 | + "source": [ | |
710 | + "dir(a)" | |
711 | + ] | |
712 | + }, | |
713 | + { | |
714 | + "cell_type": "code", | |
715 | + "execution_count": 101, | |
716 | + "id": "0a2db3b0", | |
717 | + "metadata": {}, | |
718 | + "outputs": [], | |
719 | + "source": [ | |
720 | + "a= [65, 65, 99, 8, 1, 32]\n", | |
721 | + "a.sort()" | |
722 | + ] | |
723 | + }, | |
724 | + { | |
725 | + "cell_type": "code", | |
726 | + "execution_count": 102, | |
727 | + "id": "38aa5194", | |
728 | + "metadata": {}, | |
729 | + "outputs": [ | |
730 | + { | |
731 | + "data": { | |
732 | + "text/plain": [ | |
733 | + "[1, 8, 32, 65, 65, 99]" | |
734 | + ] | |
735 | + }, | |
736 | + "execution_count": 102, | |
737 | + "metadata": {}, | |
738 | + "output_type": "execute_result" | |
739 | + } | |
740 | + ], | |
741 | + "source": [ | |
742 | + "a" | |
743 | + ] | |
744 | + }, | |
745 | + { | |
746 | + "cell_type": "code", | |
747 | + "execution_count": 103, | |
748 | + "id": "4aaafa7f", | |
749 | + "metadata": {}, | |
750 | + "outputs": [], | |
751 | + "source": [ | |
752 | + "a.reverse()" | |
753 | + ] | |
754 | + }, | |
755 | + { | |
756 | + "cell_type": "code", | |
757 | + "execution_count": 104, | |
758 | + "id": "265f3fd5", | |
759 | + "metadata": {}, | |
760 | + "outputs": [ | |
761 | + { | |
762 | + "data": { | |
763 | + "text/plain": [ | |
764 | + "[99, 65, 65, 32, 8, 1]" | |
765 | + ] | |
766 | + }, | |
767 | + "execution_count": 104, | |
768 | + "metadata": {}, | |
769 | + "output_type": "execute_result" | |
770 | + } | |
771 | + ], | |
772 | + "source": [ | |
773 | + "a" | |
774 | + ] | |
775 | + }, | |
776 | + { | |
777 | + "cell_type": "code", | |
778 | + "execution_count": 107, | |
779 | + "id": "157dd4a1", | |
780 | + "metadata": {}, | |
781 | + "outputs": [ | |
782 | + { | |
783 | + "data": { | |
784 | + "text/plain": [ | |
785 | + "5" | |
786 | + ] | |
787 | + }, | |
788 | + "execution_count": 107, | |
789 | + "metadata": {}, | |
790 | + "output_type": "execute_result" | |
791 | + } | |
792 | + ], | |
793 | + "source": [ | |
794 | + "a.index(1)" | |
795 | + ] | |
796 | + }, | |
797 | + { | |
798 | + "cell_type": "code", | |
799 | + "execution_count": 108, | |
800 | + "id": "82bcebf2", | |
801 | + "metadata": {}, | |
802 | + "outputs": [ | |
803 | + { | |
804 | + "data": { | |
805 | + "text/plain": [ | |
806 | + "[99, 65, 65, 32, 8, 1]" | |
807 | + ] | |
808 | + }, | |
809 | + "execution_count": 108, | |
810 | + "metadata": {}, | |
811 | + "output_type": "execute_result" | |
812 | + } | |
813 | + ], | |
814 | + "source": [ | |
815 | + "a" | |
816 | + ] | |
817 | + }, | |
818 | + { | |
819 | + "cell_type": "code", | |
820 | + "execution_count": 109, | |
821 | + "id": "0e9118f6", | |
822 | + "metadata": {}, | |
823 | + "outputs": [ | |
824 | + { | |
825 | + "data": { | |
826 | + "text/plain": [ | |
827 | + "[5, 'c', 'b', 'a', 1, 55]" | |
828 | + ] | |
829 | + }, | |
830 | + "execution_count": 109, | |
831 | + "metadata": {}, | |
832 | + "output_type": "execute_result" | |
833 | + } | |
834 | + ], | |
835 | + "source": [ | |
836 | + "a = [5, 'c', 'b', 'a', 1, 55]\n", | |
837 | + "a" | |
838 | + ] | |
839 | + }, | |
840 | + { | |
841 | + "cell_type": "code", | |
842 | + "execution_count": 110, | |
843 | + "id": "8d08f643", | |
844 | + "metadata": {}, | |
845 | + "outputs": [ | |
846 | + { | |
847 | + "data": { | |
848 | + "text/plain": [ | |
849 | + "[5, 88, 'c', 'b', 'a', 1, 55]" | |
850 | + ] | |
851 | + }, | |
852 | + "execution_count": 110, | |
853 | + "metadata": {}, | |
854 | + "output_type": "execute_result" | |
855 | + } | |
856 | + ], | |
857 | + "source": [ | |
858 | + "a.insert(1, 88)\n", | |
859 | + "a" | |
860 | + ] | |
861 | + }, | |
862 | + { | |
863 | + "cell_type": "code", | |
864 | + "execution_count": 111, | |
865 | + "id": "b717dcac", | |
866 | + "metadata": {}, | |
867 | + "outputs": [ | |
868 | + { | |
869 | + "data": { | |
870 | + "text/plain": [ | |
871 | + "[5, 88, 'c', 'b', 'Hello', 'a', 1, 55]" | |
872 | + ] | |
873 | + }, | |
874 | + "execution_count": 111, | |
875 | + "metadata": {}, | |
876 | + "output_type": "execute_result" | |
877 | + } | |
878 | + ], | |
879 | + "source": [ | |
880 | + "a.insert(4, \"Hello\")\n", | |
881 | + "a" | |
882 | + ] | |
883 | + }, | |
884 | + { | |
885 | + "cell_type": "code", | |
886 | + "execution_count": 112, | |
887 | + "id": "604d77dd", | |
888 | + "metadata": {}, | |
889 | + "outputs": [ | |
890 | + { | |
891 | + "data": { | |
892 | + "text/plain": [ | |
893 | + "[5, 'c', 'b', 'Hello', 'a', 1, 55]" | |
894 | + ] | |
895 | + }, | |
896 | + "execution_count": 112, | |
897 | + "metadata": {}, | |
898 | + "output_type": "execute_result" | |
899 | + } | |
900 | + ], | |
901 | + "source": [ | |
902 | + "del a[1]\n", | |
903 | + "a" | |
904 | + ] | |
905 | + }, | |
906 | + { | |
907 | + "cell_type": "code", | |
908 | + "execution_count": 113, | |
909 | + "id": "de2baeaf", | |
910 | + "metadata": {}, | |
911 | + "outputs": [], | |
912 | + "source": [ | |
913 | + "a.remove('Hello')" | |
914 | + ] | |
915 | + }, | |
916 | + { | |
917 | + "cell_type": "code", | |
918 | + "execution_count": 114, | |
919 | + "id": "b1679dcf", | |
920 | + "metadata": {}, | |
921 | + "outputs": [ | |
922 | + { | |
923 | + "data": { | |
924 | + "text/plain": [ | |
925 | + "[5, 'c', 'b', 'a', 1, 55]" | |
926 | + ] | |
927 | + }, | |
928 | + "execution_count": 114, | |
929 | + "metadata": {}, | |
930 | + "output_type": "execute_result" | |
931 | + } | |
932 | + ], | |
933 | + "source": [ | |
934 | + "a" | |
935 | + ] | |
936 | + }, | |
937 | + { | |
938 | + "cell_type": "code", | |
939 | + "execution_count": null, | |
940 | + "id": "69927842", | |
941 | + "metadata": {}, | |
942 | + "outputs": [], | |
943 | + "source": [] | |
944 | + }, | |
945 | + { | |
946 | + "cell_type": "code", | |
947 | + "execution_count": null, | |
948 | + "id": "702e5b62", | |
949 | + "metadata": {}, | |
950 | + "outputs": [], | |
951 | + "source": [] | |
952 | + }, | |
953 | + { | |
954 | + "cell_type": "code", | |
955 | + "execution_count": null, | |
956 | + "id": "7c304140", | |
957 | + "metadata": {}, | |
958 | + "outputs": [], | |
959 | + "source": [] | |
960 | + }, | |
961 | + { | |
962 | + "cell_type": "code", | |
963 | + "execution_count": null, | |
964 | + "id": "3d5e038d", | |
965 | + "metadata": {}, | |
966 | + "outputs": [], | |
967 | + "source": [] | |
968 | + }, | |
969 | + { | |
970 | + "cell_type": "code", | |
971 | + "execution_count": null, | |
972 | + "id": "b82f2523", | |
973 | + "metadata": {}, | |
974 | + "outputs": [], | |
975 | + "source": [] | |
976 | + }, | |
977 | + { | |
978 | + "cell_type": "code", | |
979 | + "execution_count": null, | |
980 | + "id": "a04aa98c", | |
981 | + "metadata": {}, | |
982 | + "outputs": [], | |
983 | + "source": [] | |
984 | + }, | |
985 | + { | |
986 | + "cell_type": "code", | |
987 | + "execution_count": null, | |
988 | + "id": "2c00c223", | |
989 | + "metadata": {}, | |
990 | + "outputs": [], | |
991 | + "source": [] | |
992 | + }, | |
993 | + { | |
994 | + "cell_type": "code", | |
995 | + "execution_count": null, | |
996 | + "id": "e4f1ff19", | |
997 | + "metadata": {}, | |
998 | + "outputs": [], | |
999 | + "source": [] | |
1000 | + }, | |
1001 | + { | |
1002 | + "cell_type": "code", | |
1003 | + "execution_count": null, | |
1004 | + "id": "5195397a", | |
1005 | + "metadata": {}, | |
1006 | + "outputs": [], | |
1007 | + "source": [] | |
1008 | + }, | |
1009 | + { | |
1010 | + "cell_type": "code", | |
1011 | + "execution_count": null, | |
1012 | + "id": "62f42eb5", | |
1013 | + "metadata": {}, | |
1014 | + "outputs": [], | |
1015 | + "source": [] | |
1016 | + }, | |
1017 | + { | |
1018 | + "cell_type": "code", | |
1019 | + "execution_count": null, | |
1020 | + "id": "44eaef61", | |
1021 | + "metadata": {}, | |
1022 | + "outputs": [], | |
1023 | + "source": [] | |
1024 | + }, | |
1025 | + { | |
1026 | + "cell_type": "code", | |
1027 | + "execution_count": null, | |
1028 | + "id": "a75af6bc", | |
1029 | + "metadata": {}, | |
1030 | + "outputs": [], | |
1031 | + "source": [] | |
1032 | + }, | |
1033 | + { | |
1034 | + "cell_type": "code", | |
1035 | + "execution_count": null, | |
1036 | + "id": "f75e538b", | |
1037 | + "metadata": {}, | |
1038 | + "outputs": [], | |
1039 | + "source": [] | |
1040 | + }, | |
1041 | + { | |
1042 | + "cell_type": "code", | |
1043 | + "execution_count": null, | |
1044 | + "id": "0a7b9318", | |
1045 | + "metadata": {}, | |
1046 | + "outputs": [], | |
1047 | + "source": [] | |
1048 | + } | |
1049 | + ], | |
1050 | + "metadata": { | |
1051 | + "kernelspec": { | |
1052 | + "display_name": "Python 3 (ipykernel)", | |
1053 | + "language": "python", | |
1054 | + "name": "python3" | |
1055 | + }, | |
1056 | + "language_info": { | |
1057 | + "codemirror_mode": { | |
1058 | + "name": "ipython", | |
1059 | + "version": 3 | |
1060 | + }, | |
1061 | + "file_extension": ".py", | |
1062 | + "mimetype": "text/x-python", | |
1063 | + "name": "python", | |
1064 | + "nbconvert_exporter": "python", | |
1065 | + "pygments_lexer": "ipython3", | |
1066 | + "version": "3.9.7" | |
1067 | + } | |
1068 | + }, | |
1069 | + "nbformat": 4, | |
1070 | + "nbformat_minor": 5 | |
1071 | +} |
+++ 20220404/tuple.ipynb
... | ... | @@ -0,0 +1,625 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 33, | |
6 | + "id": "72425bc5", | |
7 | + "metadata": {}, | |
8 | + "outputs": [ | |
9 | + { | |
10 | + "data": { | |
11 | + "text/plain": [ | |
12 | + "(1,)" | |
13 | + ] | |
14 | + }, | |
15 | + "execution_count": 33, | |
16 | + "metadata": {}, | |
17 | + "output_type": "execute_result" | |
18 | + } | |
19 | + ], | |
20 | + "source": [ | |
21 | + "t1 = (1, )\n", | |
22 | + "t1" | |
23 | + ] | |
24 | + }, | |
25 | + { | |
26 | + "cell_type": "code", | |
27 | + "execution_count": 34, | |
28 | + "id": "1b714f42", | |
29 | + "metadata": {}, | |
30 | + "outputs": [ | |
31 | + { | |
32 | + "data": { | |
33 | + "text/plain": [ | |
34 | + "(1, 2, 3)" | |
35 | + ] | |
36 | + }, | |
37 | + "execution_count": 34, | |
38 | + "metadata": {}, | |
39 | + "output_type": "execute_result" | |
40 | + } | |
41 | + ], | |
42 | + "source": [ | |
43 | + "# Tuple Must in '()'\n", | |
44 | + "t2 = (1, 2, 3)\n", | |
45 | + "t3 = 1, 2, 3\n", | |
46 | + "t2\n", | |
47 | + "t3" | |
48 | + ] | |
49 | + }, | |
50 | + { | |
51 | + "cell_type": "code", | |
52 | + "execution_count": 35, | |
53 | + "id": "7102fafb", | |
54 | + "metadata": {}, | |
55 | + "outputs": [ | |
56 | + { | |
57 | + "data": { | |
58 | + "text/plain": [ | |
59 | + "(1, 2, (3, 4), ('Life', 'is'))" | |
60 | + ] | |
61 | + }, | |
62 | + "execution_count": 35, | |
63 | + "metadata": {}, | |
64 | + "output_type": "execute_result" | |
65 | + } | |
66 | + ], | |
67 | + "source": [ | |
68 | + "t4 = (1, 2, (3, 4), ('Life', 'is'))\n", | |
69 | + "t4" | |
70 | + ] | |
71 | + }, | |
72 | + { | |
73 | + "cell_type": "code", | |
74 | + "execution_count": 36, | |
75 | + "id": "7ef38820", | |
76 | + "metadata": {}, | |
77 | + "outputs": [ | |
78 | + { | |
79 | + "data": { | |
80 | + "text/plain": [ | |
81 | + "4" | |
82 | + ] | |
83 | + }, | |
84 | + "execution_count": 36, | |
85 | + "metadata": {}, | |
86 | + "output_type": "execute_result" | |
87 | + } | |
88 | + ], | |
89 | + "source": [ | |
90 | + "t4[2][-1]" | |
91 | + ] | |
92 | + }, | |
93 | + { | |
94 | + "cell_type": "code", | |
95 | + "execution_count": 37, | |
96 | + "id": "13b2d9c0", | |
97 | + "metadata": {}, | |
98 | + "outputs": [ | |
99 | + { | |
100 | + "data": { | |
101 | + "text/plain": [ | |
102 | + "(1, 1, 2, 3)" | |
103 | + ] | |
104 | + }, | |
105 | + "execution_count": 37, | |
106 | + "metadata": {}, | |
107 | + "output_type": "execute_result" | |
108 | + } | |
109 | + ], | |
110 | + "source": [ | |
111 | + "t1 + t2" | |
112 | + ] | |
113 | + }, | |
114 | + { | |
115 | + "cell_type": "code", | |
116 | + "execution_count": 38, | |
117 | + "id": "48625967", | |
118 | + "metadata": {}, | |
119 | + "outputs": [ | |
120 | + { | |
121 | + "data": { | |
122 | + "text/plain": [ | |
123 | + "(1, 2, 3, 1, 2, 3, 1, 2, 3)" | |
124 | + ] | |
125 | + }, | |
126 | + "execution_count": 38, | |
127 | + "metadata": {}, | |
128 | + "output_type": "execute_result" | |
129 | + } | |
130 | + ], | |
131 | + "source": [ | |
132 | + "t2 * 3" | |
133 | + ] | |
134 | + }, | |
135 | + { | |
136 | + "cell_type": "code", | |
137 | + "execution_count": 39, | |
138 | + "id": "c948876e", | |
139 | + "metadata": {}, | |
140 | + "outputs": [ | |
141 | + { | |
142 | + "data": { | |
143 | + "text/plain": [ | |
144 | + "{'name': 'Hong', 'phone': '01012345678', 'birth': '0814'}" | |
145 | + ] | |
146 | + }, | |
147 | + "execution_count": 39, | |
148 | + "metadata": {}, | |
149 | + "output_type": "execute_result" | |
150 | + } | |
151 | + ], | |
152 | + "source": [ | |
153 | + "dic = {'name':'Hong', 'phone':'01012345678', 'birth':'0814'}\n", | |
154 | + "dic" | |
155 | + ] | |
156 | + }, | |
157 | + { | |
158 | + "cell_type": "code", | |
159 | + "execution_count": 40, | |
160 | + "id": "24a5d503", | |
161 | + "metadata": {}, | |
162 | + "outputs": [ | |
163 | + { | |
164 | + "data": { | |
165 | + "text/plain": [ | |
166 | + "'Hong'" | |
167 | + ] | |
168 | + }, | |
169 | + "execution_count": 40, | |
170 | + "metadata": {}, | |
171 | + "output_type": "execute_result" | |
172 | + } | |
173 | + ], | |
174 | + "source": [ | |
175 | + "dic['name']" | |
176 | + ] | |
177 | + }, | |
178 | + { | |
179 | + "cell_type": "code", | |
180 | + "execution_count": 41, | |
181 | + "id": "5209ec19", | |
182 | + "metadata": {}, | |
183 | + "outputs": [ | |
184 | + { | |
185 | + "data": { | |
186 | + "text/plain": [ | |
187 | + "'01012345678'" | |
188 | + ] | |
189 | + }, | |
190 | + "execution_count": 41, | |
191 | + "metadata": {}, | |
192 | + "output_type": "execute_result" | |
193 | + } | |
194 | + ], | |
195 | + "source": [ | |
196 | + "dic['phone']" | |
197 | + ] | |
198 | + }, | |
199 | + { | |
200 | + "cell_type": "code", | |
201 | + "execution_count": 42, | |
202 | + "id": "8c66ad44", | |
203 | + "metadata": {}, | |
204 | + "outputs": [ | |
205 | + { | |
206 | + "data": { | |
207 | + "text/plain": [ | |
208 | + "'0814'" | |
209 | + ] | |
210 | + }, | |
211 | + "execution_count": 42, | |
212 | + "metadata": {}, | |
213 | + "output_type": "execute_result" | |
214 | + } | |
215 | + ], | |
216 | + "source": [ | |
217 | + "dic['birth']" | |
218 | + ] | |
219 | + }, | |
220 | + { | |
221 | + "cell_type": "code", | |
222 | + "execution_count": 43, | |
223 | + "id": "d75ac067", | |
224 | + "metadata": {}, | |
225 | + "outputs": [ | |
226 | + { | |
227 | + "data": { | |
228 | + "text/plain": [ | |
229 | + "{'name': 'Hong', 'phone': '01012345678', 'birth': '0814', 1: 'a'}" | |
230 | + ] | |
231 | + }, | |
232 | + "execution_count": 43, | |
233 | + "metadata": {}, | |
234 | + "output_type": "execute_result" | |
235 | + } | |
236 | + ], | |
237 | + "source": [ | |
238 | + "dic[1] = 'a'\n", | |
239 | + "dic" | |
240 | + ] | |
241 | + }, | |
242 | + { | |
243 | + "cell_type": "code", | |
244 | + "execution_count": 44, | |
245 | + "id": "1c9a62b8", | |
246 | + "metadata": {}, | |
247 | + "outputs": [], | |
248 | + "source": [ | |
249 | + "dic['pet'] = 'dog'" | |
250 | + ] | |
251 | + }, | |
252 | + { | |
253 | + "cell_type": "code", | |
254 | + "execution_count": 45, | |
255 | + "id": "28e960d9", | |
256 | + "metadata": {}, | |
257 | + "outputs": [ | |
258 | + { | |
259 | + "data": { | |
260 | + "text/plain": [ | |
261 | + "{'name': 'Hong', 'phone': '01012345678', 'birth': '0814', 1: 'a', 'pet': 'dog'}" | |
262 | + ] | |
263 | + }, | |
264 | + "execution_count": 45, | |
265 | + "metadata": {}, | |
266 | + "output_type": "execute_result" | |
267 | + } | |
268 | + ], | |
269 | + "source": [ | |
270 | + "dic" | |
271 | + ] | |
272 | + }, | |
273 | + { | |
274 | + "cell_type": "code", | |
275 | + "execution_count": 46, | |
276 | + "id": "94836ccf", | |
277 | + "metadata": {}, | |
278 | + "outputs": [ | |
279 | + { | |
280 | + "data": { | |
281 | + "text/plain": [ | |
282 | + "{'name': 'Hong', 'phone': '01012345678', 'birth': '0814', 'pet': 'dog'}" | |
283 | + ] | |
284 | + }, | |
285 | + "execution_count": 46, | |
286 | + "metadata": {}, | |
287 | + "output_type": "execute_result" | |
288 | + } | |
289 | + ], | |
290 | + "source": [ | |
291 | + "del dic[1]\n", | |
292 | + "dic" | |
293 | + ] | |
294 | + }, | |
295 | + { | |
296 | + "cell_type": "code", | |
297 | + "execution_count": 47, | |
298 | + "id": "9d650023", | |
299 | + "metadata": {}, | |
300 | + "outputs": [ | |
301 | + { | |
302 | + "data": { | |
303 | + "text/plain": [ | |
304 | + "dict_keys(['name', 'phone', 'birth', 'pet'])" | |
305 | + ] | |
306 | + }, | |
307 | + "execution_count": 47, | |
308 | + "metadata": {}, | |
309 | + "output_type": "execute_result" | |
310 | + } | |
311 | + ], | |
312 | + "source": [ | |
313 | + "dic.keys()" | |
314 | + ] | |
315 | + }, | |
316 | + { | |
317 | + "cell_type": "code", | |
318 | + "execution_count": 48, | |
319 | + "id": "979161a7", | |
320 | + "metadata": {}, | |
321 | + "outputs": [ | |
322 | + { | |
323 | + "data": { | |
324 | + "text/plain": [ | |
325 | + "['name', 'phone', 'birth', 'pet']" | |
326 | + ] | |
327 | + }, | |
328 | + "execution_count": 48, | |
329 | + "metadata": {}, | |
330 | + "output_type": "execute_result" | |
331 | + } | |
332 | + ], | |
333 | + "source": [ | |
334 | + "list(dic.keys())" | |
335 | + ] | |
336 | + }, | |
337 | + { | |
338 | + "cell_type": "code", | |
339 | + "execution_count": 49, | |
340 | + "id": "ebb6e9e3", | |
341 | + "metadata": {}, | |
342 | + "outputs": [ | |
343 | + { | |
344 | + "data": { | |
345 | + "text/plain": [ | |
346 | + "dict_values(['Hong', '01012345678', '0814', 'dog'])" | |
347 | + ] | |
348 | + }, | |
349 | + "execution_count": 49, | |
350 | + "metadata": {}, | |
351 | + "output_type": "execute_result" | |
352 | + } | |
353 | + ], | |
354 | + "source": [ | |
355 | + "dic.values()" | |
356 | + ] | |
357 | + }, | |
358 | + { | |
359 | + "cell_type": "code", | |
360 | + "execution_count": 50, | |
361 | + "id": "d0d7892b", | |
362 | + "metadata": {}, | |
363 | + "outputs": [ | |
364 | + { | |
365 | + "data": { | |
366 | + "text/plain": [ | |
367 | + "['Hong', '01012345678', '0814', 'dog']" | |
368 | + ] | |
369 | + }, | |
370 | + "execution_count": 50, | |
371 | + "metadata": {}, | |
372 | + "output_type": "execute_result" | |
373 | + } | |
374 | + ], | |
375 | + "source": [ | |
376 | + "list(dic.values())" | |
377 | + ] | |
378 | + }, | |
379 | + { | |
380 | + "cell_type": "code", | |
381 | + "execution_count": 51, | |
382 | + "id": "a9001930", | |
383 | + "metadata": {}, | |
384 | + "outputs": [ | |
385 | + { | |
386 | + "data": { | |
387 | + "text/plain": [ | |
388 | + "dict_items([('name', 'Hong'), ('phone', '01012345678'), ('birth', '0814'), ('pet', 'dog')])" | |
389 | + ] | |
390 | + }, | |
391 | + "execution_count": 51, | |
392 | + "metadata": {}, | |
393 | + "output_type": "execute_result" | |
394 | + } | |
395 | + ], | |
396 | + "source": [ | |
397 | + "dic.items()" | |
398 | + ] | |
399 | + }, | |
400 | + { | |
401 | + "cell_type": "code", | |
402 | + "execution_count": 52, | |
403 | + "id": "4e542b31", | |
404 | + "metadata": {}, | |
405 | + "outputs": [], | |
406 | + "source": [ | |
407 | + "dic[4] = 'b'" | |
408 | + ] | |
409 | + }, | |
410 | + { | |
411 | + "cell_type": "code", | |
412 | + "execution_count": 53, | |
413 | + "id": "b5498318", | |
414 | + "metadata": {}, | |
415 | + "outputs": [ | |
416 | + { | |
417 | + "data": { | |
418 | + "text/plain": [ | |
419 | + "{'name': 'Hong', 'phone': '01012345678', 'birth': '0814', 'pet': 'dog', 4: 'b'}" | |
420 | + ] | |
421 | + }, | |
422 | + "execution_count": 53, | |
423 | + "metadata": {}, | |
424 | + "output_type": "execute_result" | |
425 | + } | |
426 | + ], | |
427 | + "source": [ | |
428 | + "dic" | |
429 | + ] | |
430 | + }, | |
431 | + { | |
432 | + "cell_type": "code", | |
433 | + "execution_count": 54, | |
434 | + "id": "fe6c03cf", | |
435 | + "metadata": {}, | |
436 | + "outputs": [], | |
437 | + "source": [ | |
438 | + "dic[1] = 'a'" | |
439 | + ] | |
440 | + }, | |
441 | + { | |
442 | + "cell_type": "code", | |
443 | + "execution_count": 55, | |
444 | + "id": "993e32a4", | |
445 | + "metadata": {}, | |
446 | + "outputs": [ | |
447 | + { | |
448 | + "data": { | |
449 | + "text/plain": [ | |
450 | + "{'name': 'Hong',\n", | |
451 | + " 'phone': '01012345678',\n", | |
452 | + " 'birth': '0814',\n", | |
453 | + " 'pet': 'dog',\n", | |
454 | + " 4: 'b',\n", | |
455 | + " 1: 'a'}" | |
456 | + ] | |
457 | + }, | |
458 | + "execution_count": 55, | |
459 | + "metadata": {}, | |
460 | + "output_type": "execute_result" | |
461 | + } | |
462 | + ], | |
463 | + "source": [ | |
464 | + "dic" | |
465 | + ] | |
466 | + }, | |
467 | + { | |
468 | + "cell_type": "code", | |
469 | + "execution_count": 56, | |
470 | + "id": "dd837c27", | |
471 | + "metadata": {}, | |
472 | + "outputs": [], | |
473 | + "source": [ | |
474 | + "dic['area'] = 'kr'" | |
475 | + ] | |
476 | + }, | |
477 | + { | |
478 | + "cell_type": "code", | |
479 | + "execution_count": 57, | |
480 | + "id": "ca182035", | |
481 | + "metadata": {}, | |
482 | + "outputs": [ | |
483 | + { | |
484 | + "data": { | |
485 | + "text/plain": [ | |
486 | + "{'name': 'Hong',\n", | |
487 | + " 'phone': '01012345678',\n", | |
488 | + " 'birth': '0814',\n", | |
489 | + " 'pet': 'dog',\n", | |
490 | + " 4: 'b',\n", | |
491 | + " 1: 'a',\n", | |
492 | + " 'area': 'kr'}" | |
493 | + ] | |
494 | + }, | |
495 | + "execution_count": 57, | |
496 | + "metadata": {}, | |
497 | + "output_type": "execute_result" | |
498 | + } | |
499 | + ], | |
500 | + "source": [ | |
501 | + "dic" | |
502 | + ] | |
503 | + }, | |
504 | + { | |
505 | + "cell_type": "code", | |
506 | + "execution_count": 58, | |
507 | + "id": "caeedcc4", | |
508 | + "metadata": {}, | |
509 | + "outputs": [], | |
510 | + "source": [ | |
511 | + "import numpy as np\n", | |
512 | + "import " | |
513 | + ] | |
514 | + }, | |
515 | + { | |
516 | + "cell_type": "code", | |
517 | + "execution_count": null, | |
518 | + "id": "c4a84a53", | |
519 | + "metadata": {}, | |
520 | + "outputs": [], | |
521 | + "source": [] | |
522 | + }, | |
523 | + { | |
524 | + "cell_type": "code", | |
525 | + "execution_count": null, | |
526 | + "id": "ae7cd89b", | |
527 | + "metadata": {}, | |
528 | + "outputs": [], | |
529 | + "source": [] | |
530 | + }, | |
531 | + { | |
532 | + "cell_type": "code", | |
533 | + "execution_count": null, | |
534 | + "id": "dade6dc3", | |
535 | + "metadata": {}, | |
536 | + "outputs": [], | |
537 | + "source": [] | |
538 | + }, | |
539 | + { | |
540 | + "cell_type": "code", | |
541 | + "execution_count": null, | |
542 | + "id": "bebcd6c7", | |
543 | + "metadata": {}, | |
544 | + "outputs": [], | |
545 | + "source": [] | |
546 | + }, | |
547 | + { | |
548 | + "cell_type": "code", | |
549 | + "execution_count": null, | |
550 | + "id": "d47497b4", | |
551 | + "metadata": {}, | |
552 | + "outputs": [], | |
553 | + "source": [] | |
554 | + }, | |
555 | + { | |
556 | + "cell_type": "code", | |
557 | + "execution_count": null, | |
558 | + "id": "1253420a", | |
559 | + "metadata": {}, | |
560 | + "outputs": [], | |
561 | + "source": [] | |
562 | + }, | |
563 | + { | |
564 | + "cell_type": "code", | |
565 | + "execution_count": null, | |
566 | + "id": "b2a2618f", | |
567 | + "metadata": {}, | |
568 | + "outputs": [], | |
569 | + "source": [] | |
570 | + }, | |
571 | + { | |
572 | + "cell_type": "code", | |
573 | + "execution_count": null, | |
574 | + "id": "32ba3a15", | |
575 | + "metadata": {}, | |
576 | + "outputs": [], | |
577 | + "source": [] | |
578 | + }, | |
579 | + { | |
580 | + "cell_type": "code", | |
581 | + "execution_count": null, | |
582 | + "id": "2f5a27b1", | |
583 | + "metadata": {}, | |
584 | + "outputs": [], | |
585 | + "source": [] | |
586 | + }, | |
587 | + { | |
588 | + "cell_type": "code", | |
589 | + "execution_count": null, | |
590 | + "id": "eb7fbfb7", | |
591 | + "metadata": {}, | |
592 | + "outputs": [], | |
593 | + "source": [] | |
594 | + }, | |
595 | + { | |
596 | + "cell_type": "code", | |
597 | + "execution_count": null, | |
598 | + "id": "e76d80c4", | |
599 | + "metadata": {}, | |
600 | + "outputs": [], | |
601 | + "source": [] | |
602 | + } | |
603 | + ], | |
604 | + "metadata": { | |
605 | + "kernelspec": { | |
606 | + "display_name": "Python 3 (ipykernel)", | |
607 | + "language": "python", | |
608 | + "name": "python3" | |
609 | + }, | |
610 | + "language_info": { | |
611 | + "codemirror_mode": { | |
612 | + "name": "ipython", | |
613 | + "version": 3 | |
614 | + }, | |
615 | + "file_extension": ".py", | |
616 | + "mimetype": "text/x-python", | |
617 | + "name": "python", | |
618 | + "nbconvert_exporter": "python", | |
619 | + "pygments_lexer": "ipython3", | |
620 | + "version": "3.9.7" | |
621 | + } | |
622 | + }, | |
623 | + "nbformat": 4, | |
624 | + "nbformat_minor": 5 | |
625 | +} |
+++ 20220411/.ipynb_checkpoints/condition-checkpoint.ipynb
... | ... | @@ -0,0 +1,251 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 2, | |
6 | + "id": "557e0b11", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "x = 3\n", | |
11 | + "y = 2" | |
12 | + ] | |
13 | + }, | |
14 | + { | |
15 | + "cell_type": "code", | |
16 | + "execution_count": 3, | |
17 | + "id": "ca5c36a6", | |
18 | + "metadata": {}, | |
19 | + "outputs": [ | |
20 | + { | |
21 | + "data": { | |
22 | + "text/plain": [ | |
23 | + "False" | |
24 | + ] | |
25 | + }, | |
26 | + "execution_count": 3, | |
27 | + "metadata": {}, | |
28 | + "output_type": "execute_result" | |
29 | + } | |
30 | + ], | |
31 | + "source": [ | |
32 | + "x == y" | |
33 | + ] | |
34 | + }, | |
35 | + { | |
36 | + "cell_type": "code", | |
37 | + "execution_count": 4, | |
38 | + "id": "0d6f68ea", | |
39 | + "metadata": {}, | |
40 | + "outputs": [ | |
41 | + { | |
42 | + "data": { | |
43 | + "text/plain": [ | |
44 | + "True" | |
45 | + ] | |
46 | + }, | |
47 | + "execution_count": 4, | |
48 | + "metadata": {}, | |
49 | + "output_type": "execute_result" | |
50 | + } | |
51 | + ], | |
52 | + "source": [ | |
53 | + "x != y" | |
54 | + ] | |
55 | + }, | |
56 | + { | |
57 | + "cell_type": "code", | |
58 | + "execution_count": 5, | |
59 | + "id": "cd2be343", | |
60 | + "metadata": {}, | |
61 | + "outputs": [ | |
62 | + { | |
63 | + "data": { | |
64 | + "text/plain": [ | |
65 | + "True" | |
66 | + ] | |
67 | + }, | |
68 | + "execution_count": 5, | |
69 | + "metadata": {}, | |
70 | + "output_type": "execute_result" | |
71 | + } | |
72 | + ], | |
73 | + "source": [ | |
74 | + "x > y" | |
75 | + ] | |
76 | + }, | |
77 | + { | |
78 | + "cell_type": "code", | |
79 | + "execution_count": 6, | |
80 | + "id": "f1ff3b3d", | |
81 | + "metadata": {}, | |
82 | + "outputs": [ | |
83 | + { | |
84 | + "data": { | |
85 | + "text/plain": [ | |
86 | + "True" | |
87 | + ] | |
88 | + }, | |
89 | + "execution_count": 6, | |
90 | + "metadata": {}, | |
91 | + "output_type": "execute_result" | |
92 | + } | |
93 | + ], | |
94 | + "source": [ | |
95 | + "x >= y" | |
96 | + ] | |
97 | + }, | |
98 | + { | |
99 | + "cell_type": "code", | |
100 | + "execution_count": 12, | |
101 | + "id": "58f4edaf", | |
102 | + "metadata": { | |
103 | + "scrolled": true | |
104 | + }, | |
105 | + "outputs": [ | |
106 | + { | |
107 | + "name": "stdout", | |
108 | + "output_type": "stream", | |
109 | + "text": [ | |
110 | + "3 is bigger than 2\n" | |
111 | + ] | |
112 | + } | |
113 | + ], | |
114 | + "source": [ | |
115 | + "if x > y:\n", | |
116 | + " print(x,\"is bigger than\", y)" | |
117 | + ] | |
118 | + }, | |
119 | + { | |
120 | + "cell_type": "code", | |
121 | + "execution_count": 26, | |
122 | + "id": "e9452a71", | |
123 | + "metadata": {}, | |
124 | + "outputs": [ | |
125 | + { | |
126 | + "name": "stdout", | |
127 | + "output_type": "stream", | |
128 | + "text": [ | |
129 | + "3가 2보다 큽니다.\n" | |
130 | + ] | |
131 | + } | |
132 | + ], | |
133 | + "source": [ | |
134 | + "if x > y:\n", | |
135 | + " print(\"%d가 %d보다 큽니다.\" %(x, y))" | |
136 | + ] | |
137 | + }, | |
138 | + { | |
139 | + "cell_type": "code", | |
140 | + "execution_count": 27, | |
141 | + "id": "fbd3c853", | |
142 | + "metadata": {}, | |
143 | + "outputs": [ | |
144 | + { | |
145 | + "name": "stdout", | |
146 | + "output_type": "stream", | |
147 | + "text": [ | |
148 | + "can on\n" | |
149 | + ] | |
150 | + } | |
151 | + ], | |
152 | + "source": [ | |
153 | + "money = 1300\n", | |
154 | + "if money >= 1200 and money < 3500:\n", | |
155 | + " print(\"can on\")" | |
156 | + ] | |
157 | + }, | |
158 | + { | |
159 | + "cell_type": "code", | |
160 | + "execution_count": 29, | |
161 | + "id": "8123541a", | |
162 | + "metadata": {}, | |
163 | + "outputs": [ | |
164 | + { | |
165 | + "data": { | |
166 | + "text/plain": [ | |
167 | + "True" | |
168 | + ] | |
169 | + }, | |
170 | + "execution_count": 29, | |
171 | + "metadata": {}, | |
172 | + "output_type": "execute_result" | |
173 | + } | |
174 | + ], | |
175 | + "source": [ | |
176 | + "1 in [1, 2, 3]" | |
177 | + ] | |
178 | + }, | |
179 | + { | |
180 | + "cell_type": "code", | |
181 | + "execution_count": 31, | |
182 | + "id": "14443aa6", | |
183 | + "metadata": {}, | |
184 | + "outputs": [ | |
185 | + { | |
186 | + "data": { | |
187 | + "text/plain": [ | |
188 | + "True" | |
189 | + ] | |
190 | + }, | |
191 | + "execution_count": 31, | |
192 | + "metadata": {}, | |
193 | + "output_type": "execute_result" | |
194 | + } | |
195 | + ], | |
196 | + "source": [ | |
197 | + "5 not in [1, 2, 3]" | |
198 | + ] | |
199 | + }, | |
200 | + { | |
201 | + "cell_type": "code", | |
202 | + "execution_count": 32, | |
203 | + "id": "aa212512", | |
204 | + "metadata": {}, | |
205 | + "outputs": [ | |
206 | + { | |
207 | + "data": { | |
208 | + "text/plain": [ | |
209 | + "True" | |
210 | + ] | |
211 | + }, | |
212 | + "execution_count": 32, | |
213 | + "metadata": {}, | |
214 | + "output_type": "execute_result" | |
215 | + } | |
216 | + ], | |
217 | + "source": [ | |
218 | + "'a' in ['a', 'b ', 'c']" | |
219 | + ] | |
220 | + }, | |
221 | + { | |
222 | + "cell_type": "code", | |
223 | + "execution_count": null, | |
224 | + "id": "640a6ce9", | |
225 | + "metadata": {}, | |
226 | + "outputs": [], | |
227 | + "source": [] | |
228 | + } | |
229 | + ], | |
230 | + "metadata": { | |
231 | + "kernelspec": { | |
232 | + "display_name": "Python 3 (ipykernel)", | |
233 | + "language": "python", | |
234 | + "name": "python3" | |
235 | + }, | |
236 | + "language_info": { | |
237 | + "codemirror_mode": { | |
238 | + "name": "ipython", | |
239 | + "version": 3 | |
240 | + }, | |
241 | + "file_extension": ".py", | |
242 | + "mimetype": "text/x-python", | |
243 | + "name": "python", | |
244 | + "nbconvert_exporter": "python", | |
245 | + "pygments_lexer": "ipython3", | |
246 | + "version": "3.10.4" | |
247 | + } | |
248 | + }, | |
249 | + "nbformat": 4, | |
250 | + "nbformat_minor": 5 | |
251 | +} |
+++ 20220411/.ipynb_checkpoints/loop-checkpoint.ipynb
... | ... | @@ -0,0 +1,591 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 1, | |
6 | + "id": "7965fa5b", | |
7 | + "metadata": {}, | |
8 | + "outputs": [ | |
9 | + { | |
10 | + "name": "stdout", | |
11 | + "output_type": "stream", | |
12 | + "text": [ | |
13 | + "*\n", | |
14 | + "**\n", | |
15 | + "***\n", | |
16 | + "****\n", | |
17 | + "*****\n" | |
18 | + ] | |
19 | + } | |
20 | + ], | |
21 | + "source": [ | |
22 | + "i = 0\n", | |
23 | + "while i < 5:\n", | |
24 | + " i += 1\n", | |
25 | + " print('*' * i)" | |
26 | + ] | |
27 | + }, | |
28 | + { | |
29 | + "cell_type": "code", | |
30 | + "execution_count": 2, | |
31 | + "id": "ab4a0ddf", | |
32 | + "metadata": {}, | |
33 | + "outputs": [ | |
34 | + { | |
35 | + "name": "stdout", | |
36 | + "output_type": "stream", | |
37 | + "text": [ | |
38 | + "one\n", | |
39 | + "element length is : 3\n", | |
40 | + "two\n", | |
41 | + "element length is : 3\n", | |
42 | + "three\n", | |
43 | + "element length is : 5\n" | |
44 | + ] | |
45 | + } | |
46 | + ], | |
47 | + "source": [ | |
48 | + "l = ['one', 'two', 'three']\n", | |
49 | + "for i in l:\n", | |
50 | + " print(i)\n", | |
51 | + " print(\"element length is :\", len(i))" | |
52 | + ] | |
53 | + }, | |
54 | + { | |
55 | + "cell_type": "code", | |
56 | + "execution_count": 3, | |
57 | + "id": "d500b4ae", | |
58 | + "metadata": {}, | |
59 | + "outputs": [ | |
60 | + { | |
61 | + "name": "stdout", | |
62 | + "output_type": "stream", | |
63 | + "text": [ | |
64 | + "1번 학생은 합격(90점)입니다.\n", | |
65 | + "2번 학생은 불합격(25점)입니다.\n", | |
66 | + "3번 학생은 합격(60점)입니다.\n", | |
67 | + "4번 학생은 불합격(45점)입니다.\n", | |
68 | + "5번 학생은 합격(93점)입니다.\n" | |
69 | + ] | |
70 | + } | |
71 | + ], | |
72 | + "source": [ | |
73 | + "number = 0\n", | |
74 | + "for score in [90, 25, 60.1, 45, 93]:\n", | |
75 | + " number += 1\n", | |
76 | + " if score >= 60:\n", | |
77 | + " print(\"%d번 학생은 합격(%d점)입니다.\" %(number, score))\n", | |
78 | + " else:\n", | |
79 | + " print(\"%d번 학생은 불합격(%d점)입니다.\" %(number, score))" | |
80 | + ] | |
81 | + }, | |
82 | + { | |
83 | + "cell_type": "code", | |
84 | + "execution_count": 5, | |
85 | + "id": "f692f1bf", | |
86 | + "metadata": {}, | |
87 | + "outputs": [ | |
88 | + { | |
89 | + "name": "stdout", | |
90 | + "output_type": "stream", | |
91 | + "text": [ | |
92 | + "*****\n", | |
93 | + "****\n", | |
94 | + "***\n", | |
95 | + "**\n", | |
96 | + "*\n" | |
97 | + ] | |
98 | + } | |
99 | + ], | |
100 | + "source": [ | |
101 | + "i = 5\n", | |
102 | + "while i > 0:\n", | |
103 | + " print(\"*\" * i)\n", | |
104 | + " i -= 1" | |
105 | + ] | |
106 | + }, | |
107 | + { | |
108 | + "cell_type": "code", | |
109 | + "execution_count": 19, | |
110 | + "id": "b52d9b14", | |
111 | + "metadata": {}, | |
112 | + "outputs": [ | |
113 | + { | |
114 | + "name": "stdout", | |
115 | + "output_type": "stream", | |
116 | + "text": [ | |
117 | + "*\n", | |
118 | + "**\n", | |
119 | + "***\n", | |
120 | + "****\n", | |
121 | + "*****\n" | |
122 | + ] | |
123 | + } | |
124 | + ], | |
125 | + "source": [ | |
126 | + "i = 0\n", | |
127 | + "for i in range(5):\n", | |
128 | + " i += 1\n", | |
129 | + " print(\"*\" * i)" | |
130 | + ] | |
131 | + }, | |
132 | + { | |
133 | + "cell_type": "code", | |
134 | + "execution_count": 24, | |
135 | + "id": "df9bd043", | |
136 | + "metadata": {}, | |
137 | + "outputs": [ | |
138 | + { | |
139 | + "name": "stdout", | |
140 | + "output_type": "stream", | |
141 | + "text": [ | |
142 | + "\n", | |
143 | + "*\n", | |
144 | + "**\n", | |
145 | + "***\n", | |
146 | + "****\n", | |
147 | + "*****\n" | |
148 | + ] | |
149 | + } | |
150 | + ], | |
151 | + "source": [ | |
152 | + "for i in range(0, 6):\n", | |
153 | + " print(\"*\" * i)" | |
154 | + ] | |
155 | + }, | |
156 | + { | |
157 | + "cell_type": "code", | |
158 | + "execution_count": 25, | |
159 | + "id": "e8caf336", | |
160 | + "metadata": {}, | |
161 | + "outputs": [ | |
162 | + { | |
163 | + "name": "stdout", | |
164 | + "output_type": "stream", | |
165 | + "text": [ | |
166 | + "*\n", | |
167 | + "***\n", | |
168 | + "*****\n", | |
169 | + "*******\n", | |
170 | + "*********\n" | |
171 | + ] | |
172 | + } | |
173 | + ], | |
174 | + "source": [ | |
175 | + "for i in range(1, 11, 2):\n", | |
176 | + " print(\"*\" * i)" | |
177 | + ] | |
178 | + }, | |
179 | + { | |
180 | + "cell_type": "code", | |
181 | + "execution_count": 27, | |
182 | + "id": "f75ee029", | |
183 | + "metadata": {}, | |
184 | + "outputs": [ | |
185 | + { | |
186 | + "name": "stdout", | |
187 | + "output_type": "stream", | |
188 | + "text": [ | |
189 | + "*****\n", | |
190 | + "****\n", | |
191 | + "***\n", | |
192 | + "**\n", | |
193 | + "*\n" | |
194 | + ] | |
195 | + } | |
196 | + ], | |
197 | + "source": [ | |
198 | + "i = 5\n", | |
199 | + "while i > 0:\n", | |
200 | + " print(\"*\" * i)\n", | |
201 | + " i -= 1" | |
202 | + ] | |
203 | + }, | |
204 | + { | |
205 | + "cell_type": "code", | |
206 | + "execution_count": 29, | |
207 | + "id": "f2abcb85", | |
208 | + "metadata": {}, | |
209 | + "outputs": [ | |
210 | + { | |
211 | + "name": "stdout", | |
212 | + "output_type": "stream", | |
213 | + "text": [ | |
214 | + "*****\n", | |
215 | + "****\n", | |
216 | + "***\n", | |
217 | + "**\n", | |
218 | + "*\n" | |
219 | + ] | |
220 | + } | |
221 | + ], | |
222 | + "source": [ | |
223 | + "for i in range(5, 0, -1):\n", | |
224 | + " print(\"*\" * i)" | |
225 | + ] | |
226 | + }, | |
227 | + { | |
228 | + "cell_type": "code", | |
229 | + "execution_count": 33, | |
230 | + "id": "fbd0824c", | |
231 | + "metadata": {}, | |
232 | + "outputs": [ | |
233 | + { | |
234 | + "name": "stdout", | |
235 | + "output_type": "stream", | |
236 | + "text": [ | |
237 | + "4\n" | |
238 | + ] | |
239 | + } | |
240 | + ], | |
241 | + "source": [ | |
242 | + "def sum1(a, b):\n", | |
243 | + " x = a + b\n", | |
244 | + " return x\n", | |
245 | + "\n", | |
246 | + "print(sum1(2, 2))" | |
247 | + ] | |
248 | + }, | |
249 | + { | |
250 | + "cell_type": "code", | |
251 | + "execution_count": 37, | |
252 | + "id": "389b2569", | |
253 | + "metadata": {}, | |
254 | + "outputs": [ | |
255 | + { | |
256 | + "data": { | |
257 | + "text/plain": [ | |
258 | + "9" | |
259 | + ] | |
260 | + }, | |
261 | + "execution_count": 37, | |
262 | + "metadata": {}, | |
263 | + "output_type": "execute_result" | |
264 | + } | |
265 | + ], | |
266 | + "source": [ | |
267 | + "def sum3(*args):\n", | |
268 | + " x = 0\n", | |
269 | + " for i in args:\n", | |
270 | + " x += i\n", | |
271 | + " return x\n", | |
272 | + "sum3(3, 3, 3)" | |
273 | + ] | |
274 | + }, | |
275 | + { | |
276 | + "cell_type": "code", | |
277 | + "execution_count": 50, | |
278 | + "id": "5f9d182a", | |
279 | + "metadata": {}, | |
280 | + "outputs": [], | |
281 | + "source": [ | |
282 | + "def star(*args):\n", | |
283 | + " for i in args:\n", | |
284 | + " print(\"*\" * i)" | |
285 | + ] | |
286 | + }, | |
287 | + { | |
288 | + "cell_type": "code", | |
289 | + "execution_count": 51, | |
290 | + "id": "d0a32e25", | |
291 | + "metadata": {}, | |
292 | + "outputs": [ | |
293 | + { | |
294 | + "name": "stdout", | |
295 | + "output_type": "stream", | |
296 | + "text": [ | |
297 | + "*****\n", | |
298 | + "***\n", | |
299 | + "**\n", | |
300 | + "******************************************************\n", | |
301 | + "****\n" | |
302 | + ] | |
303 | + } | |
304 | + ], | |
305 | + "source": [ | |
306 | + "star(5, 3, 2, 54, 4)" | |
307 | + ] | |
308 | + }, | |
309 | + { | |
310 | + "cell_type": "code", | |
311 | + "execution_count": 52, | |
312 | + "id": "3aa6e066", | |
313 | + "metadata": {}, | |
314 | + "outputs": [], | |
315 | + "source": [ | |
316 | + "# internal function" | |
317 | + ] | |
318 | + }, | |
319 | + { | |
320 | + "cell_type": "code", | |
321 | + "execution_count": 54, | |
322 | + "id": "67bad3f1", | |
323 | + "metadata": {}, | |
324 | + "outputs": [ | |
325 | + { | |
326 | + "data": { | |
327 | + "text/plain": [ | |
328 | + "3" | |
329 | + ] | |
330 | + }, | |
331 | + "execution_count": 54, | |
332 | + "metadata": {}, | |
333 | + "output_type": "execute_result" | |
334 | + } | |
335 | + ], | |
336 | + "source": [ | |
337 | + "abs(-3) # absolute" | |
338 | + ] | |
339 | + }, | |
340 | + { | |
341 | + "cell_type": "code", | |
342 | + "execution_count": 59, | |
343 | + "id": "9da6a225", | |
344 | + "metadata": {}, | |
345 | + "outputs": [ | |
346 | + { | |
347 | + "data": { | |
348 | + "text/plain": [ | |
349 | + "True" | |
350 | + ] | |
351 | + }, | |
352 | + "execution_count": 59, | |
353 | + "metadata": {}, | |
354 | + "output_type": "execute_result" | |
355 | + } | |
356 | + ], | |
357 | + "source": [ | |
358 | + "all([1, 2, 3, 4])" | |
359 | + ] | |
360 | + }, | |
361 | + { | |
362 | + "cell_type": "code", | |
363 | + "execution_count": 61, | |
364 | + "id": "66433eb0", | |
365 | + "metadata": {}, | |
366 | + "outputs": [ | |
367 | + { | |
368 | + "data": { | |
369 | + "text/plain": [ | |
370 | + "True" | |
371 | + ] | |
372 | + }, | |
373 | + "execution_count": 61, | |
374 | + "metadata": {}, | |
375 | + "output_type": "execute_result" | |
376 | + } | |
377 | + ], | |
378 | + "source": [ | |
379 | + "any([0, 0, 0, 0, 0, 1])" | |
380 | + ] | |
381 | + }, | |
382 | + { | |
383 | + "cell_type": "code", | |
384 | + "execution_count": 65, | |
385 | + "id": "fe4d4119", | |
386 | + "metadata": {}, | |
387 | + "outputs": [ | |
388 | + { | |
389 | + "data": { | |
390 | + "text/plain": [ | |
391 | + "'a'" | |
392 | + ] | |
393 | + }, | |
394 | + "execution_count": 65, | |
395 | + "metadata": {}, | |
396 | + "output_type": "execute_result" | |
397 | + } | |
398 | + ], | |
399 | + "source": [ | |
400 | + "chr(97)" | |
401 | + ] | |
402 | + }, | |
403 | + { | |
404 | + "cell_type": "code", | |
405 | + "execution_count": 66, | |
406 | + "id": "8238d660", | |
407 | + "metadata": {}, | |
408 | + "outputs": [ | |
409 | + { | |
410 | + "data": { | |
411 | + "text/plain": [ | |
412 | + "97" | |
413 | + ] | |
414 | + }, | |
415 | + "execution_count": 66, | |
416 | + "metadata": {}, | |
417 | + "output_type": "execute_result" | |
418 | + } | |
419 | + ], | |
420 | + "source": [ | |
421 | + "ord('a')" | |
422 | + ] | |
423 | + }, | |
424 | + { | |
425 | + "cell_type": "code", | |
426 | + "execution_count": 76, | |
427 | + "id": "2c356f2a", | |
428 | + "metadata": {}, | |
429 | + "outputs": [ | |
430 | + { | |
431 | + "data": { | |
432 | + "text/plain": [ | |
433 | + "1" | |
434 | + ] | |
435 | + }, | |
436 | + "execution_count": 76, | |
437 | + "metadata": {}, | |
438 | + "output_type": "execute_result" | |
439 | + } | |
440 | + ], | |
441 | + "source": [ | |
442 | + "a = 1\n", | |
443 | + "a.real" | |
444 | + ] | |
445 | + }, | |
446 | + { | |
447 | + "cell_type": "code", | |
448 | + "execution_count": 78, | |
449 | + "id": "5bda70d3", | |
450 | + "metadata": {}, | |
451 | + "outputs": [ | |
452 | + { | |
453 | + "data": { | |
454 | + "text/plain": [ | |
455 | + "(2, 1)" | |
456 | + ] | |
457 | + }, | |
458 | + "execution_count": 78, | |
459 | + "metadata": {}, | |
460 | + "output_type": "execute_result" | |
461 | + } | |
462 | + ], | |
463 | + "source": [ | |
464 | + "divmod(7, 3)" | |
465 | + ] | |
466 | + }, | |
467 | + { | |
468 | + "cell_type": "code", | |
469 | + "execution_count": 84, | |
470 | + "id": "c389c244", | |
471 | + "metadata": {}, | |
472 | + "outputs": [ | |
473 | + { | |
474 | + "data": { | |
475 | + "text/plain": [ | |
476 | + "6" | |
477 | + ] | |
478 | + }, | |
479 | + "execution_count": 84, | |
480 | + "metadata": {}, | |
481 | + "output_type": "execute_result" | |
482 | + } | |
483 | + ], | |
484 | + "source": [ | |
485 | + "sum = lambda a,b: a+b # anonymous function\n", | |
486 | + "sum(2, 4)" | |
487 | + ] | |
488 | + }, | |
489 | + { | |
490 | + "cell_type": "code", | |
491 | + "execution_count": null, | |
492 | + "id": "a1776047", | |
493 | + "metadata": {}, | |
494 | + "outputs": [], | |
495 | + "source": [] | |
496 | + }, | |
497 | + { | |
498 | + "cell_type": "code", | |
499 | + "execution_count": null, | |
500 | + "id": "b2c9465e", | |
501 | + "metadata": {}, | |
502 | + "outputs": [], | |
503 | + "source": [] | |
504 | + }, | |
505 | + { | |
506 | + "cell_type": "code", | |
507 | + "execution_count": null, | |
508 | + "id": "7c2639a8", | |
509 | + "metadata": {}, | |
510 | + "outputs": [], | |
511 | + "source": [] | |
512 | + }, | |
513 | + { | |
514 | + "cell_type": "code", | |
515 | + "execution_count": null, | |
516 | + "id": "bed9db87", | |
517 | + "metadata": {}, | |
518 | + "outputs": [], | |
519 | + "source": [] | |
520 | + }, | |
521 | + { | |
522 | + "cell_type": "code", | |
523 | + "execution_count": null, | |
524 | + "id": "66ea3e0c", | |
525 | + "metadata": {}, | |
526 | + "outputs": [], | |
527 | + "source": [] | |
528 | + }, | |
529 | + { | |
530 | + "cell_type": "code", | |
531 | + "execution_count": null, | |
532 | + "id": "91cd5457", | |
533 | + "metadata": {}, | |
534 | + "outputs": [], | |
535 | + "source": [] | |
536 | + }, | |
537 | + { | |
538 | + "cell_type": "code", | |
539 | + "execution_count": null, | |
540 | + "id": "eeff7c14", | |
541 | + "metadata": {}, | |
542 | + "outputs": [], | |
543 | + "source": [] | |
544 | + }, | |
545 | + { | |
546 | + "cell_type": "code", | |
547 | + "execution_count": null, | |
548 | + "id": "d3c5d49a", | |
549 | + "metadata": {}, | |
550 | + "outputs": [], | |
551 | + "source": [] | |
552 | + }, | |
553 | + { | |
554 | + "cell_type": "code", | |
555 | + "execution_count": null, | |
556 | + "id": "c65732e9", | |
557 | + "metadata": {}, | |
558 | + "outputs": [], | |
559 | + "source": [] | |
560 | + }, | |
561 | + { | |
562 | + "cell_type": "code", | |
563 | + "execution_count": null, | |
564 | + "id": "9f4f90c7", | |
565 | + "metadata": {}, | |
566 | + "outputs": [], | |
567 | + "source": [] | |
568 | + } | |
569 | + ], | |
570 | + "metadata": { | |
571 | + "kernelspec": { | |
572 | + "display_name": "Python 3 (ipykernel)", | |
573 | + "language": "python", | |
574 | + "name": "python3" | |
575 | + }, | |
576 | + "language_info": { | |
577 | + "codemirror_mode": { | |
578 | + "name": "ipython", | |
579 | + "version": 3 | |
580 | + }, | |
581 | + "file_extension": ".py", | |
582 | + "mimetype": "text/x-python", | |
583 | + "name": "python", | |
584 | + "nbconvert_exporter": "python", | |
585 | + "pygments_lexer": "ipython3", | |
586 | + "version": "3.10.4" | |
587 | + } | |
588 | + }, | |
589 | + "nbformat": 4, | |
590 | + "nbformat_minor": 5 | |
591 | +} |
+++ 20220411/condition.ipynb
... | ... | @@ -0,0 +1,251 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 2, | |
6 | + "id": "557e0b11", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "x = 3\n", | |
11 | + "y = 2" | |
12 | + ] | |
13 | + }, | |
14 | + { | |
15 | + "cell_type": "code", | |
16 | + "execution_count": 3, | |
17 | + "id": "ca5c36a6", | |
18 | + "metadata": {}, | |
19 | + "outputs": [ | |
20 | + { | |
21 | + "data": { | |
22 | + "text/plain": [ | |
23 | + "False" | |
24 | + ] | |
25 | + }, | |
26 | + "execution_count": 3, | |
27 | + "metadata": {}, | |
28 | + "output_type": "execute_result" | |
29 | + } | |
30 | + ], | |
31 | + "source": [ | |
32 | + "x == y" | |
33 | + ] | |
34 | + }, | |
35 | + { | |
36 | + "cell_type": "code", | |
37 | + "execution_count": 4, | |
38 | + "id": "0d6f68ea", | |
39 | + "metadata": {}, | |
40 | + "outputs": [ | |
41 | + { | |
42 | + "data": { | |
43 | + "text/plain": [ | |
44 | + "True" | |
45 | + ] | |
46 | + }, | |
47 | + "execution_count": 4, | |
48 | + "metadata": {}, | |
49 | + "output_type": "execute_result" | |
50 | + } | |
51 | + ], | |
52 | + "source": [ | |
53 | + "x != y" | |
54 | + ] | |
55 | + }, | |
56 | + { | |
57 | + "cell_type": "code", | |
58 | + "execution_count": 5, | |
59 | + "id": "cd2be343", | |
60 | + "metadata": {}, | |
61 | + "outputs": [ | |
62 | + { | |
63 | + "data": { | |
64 | + "text/plain": [ | |
65 | + "True" | |
66 | + ] | |
67 | + }, | |
68 | + "execution_count": 5, | |
69 | + "metadata": {}, | |
70 | + "output_type": "execute_result" | |
71 | + } | |
72 | + ], | |
73 | + "source": [ | |
74 | + "x > y" | |
75 | + ] | |
76 | + }, | |
77 | + { | |
78 | + "cell_type": "code", | |
79 | + "execution_count": 6, | |
80 | + "id": "f1ff3b3d", | |
81 | + "metadata": {}, | |
82 | + "outputs": [ | |
83 | + { | |
84 | + "data": { | |
85 | + "text/plain": [ | |
86 | + "True" | |
87 | + ] | |
88 | + }, | |
89 | + "execution_count": 6, | |
90 | + "metadata": {}, | |
91 | + "output_type": "execute_result" | |
92 | + } | |
93 | + ], | |
94 | + "source": [ | |
95 | + "x >= y" | |
96 | + ] | |
97 | + }, | |
98 | + { | |
99 | + "cell_type": "code", | |
100 | + "execution_count": 12, | |
101 | + "id": "58f4edaf", | |
102 | + "metadata": { | |
103 | + "scrolled": true | |
104 | + }, | |
105 | + "outputs": [ | |
106 | + { | |
107 | + "name": "stdout", | |
108 | + "output_type": "stream", | |
109 | + "text": [ | |
110 | + "3 is bigger than 2\n" | |
111 | + ] | |
112 | + } | |
113 | + ], | |
114 | + "source": [ | |
115 | + "if x > y:\n", | |
116 | + " print(x,\"is bigger than\", y)" | |
117 | + ] | |
118 | + }, | |
119 | + { | |
120 | + "cell_type": "code", | |
121 | + "execution_count": 26, | |
122 | + "id": "e9452a71", | |
123 | + "metadata": {}, | |
124 | + "outputs": [ | |
125 | + { | |
126 | + "name": "stdout", | |
127 | + "output_type": "stream", | |
128 | + "text": [ | |
129 | + "3가 2보다 큽니다.\n" | |
130 | + ] | |
131 | + } | |
132 | + ], | |
133 | + "source": [ | |
134 | + "if x > y:\n", | |
135 | + " print(\"%d가 %d보다 큽니다.\" %(x, y))" | |
136 | + ] | |
137 | + }, | |
138 | + { | |
139 | + "cell_type": "code", | |
140 | + "execution_count": 27, | |
141 | + "id": "fbd3c853", | |
142 | + "metadata": {}, | |
143 | + "outputs": [ | |
144 | + { | |
145 | + "name": "stdout", | |
146 | + "output_type": "stream", | |
147 | + "text": [ | |
148 | + "can on\n" | |
149 | + ] | |
150 | + } | |
151 | + ], | |
152 | + "source": [ | |
153 | + "money = 1300\n", | |
154 | + "if money >= 1200 and money < 3500:\n", | |
155 | + " print(\"can on\")" | |
156 | + ] | |
157 | + }, | |
158 | + { | |
159 | + "cell_type": "code", | |
160 | + "execution_count": 29, | |
161 | + "id": "8123541a", | |
162 | + "metadata": {}, | |
163 | + "outputs": [ | |
164 | + { | |
165 | + "data": { | |
166 | + "text/plain": [ | |
167 | + "True" | |
168 | + ] | |
169 | + }, | |
170 | + "execution_count": 29, | |
171 | + "metadata": {}, | |
172 | + "output_type": "execute_result" | |
173 | + } | |
174 | + ], | |
175 | + "source": [ | |
176 | + "1 in [1, 2, 3]" | |
177 | + ] | |
178 | + }, | |
179 | + { | |
180 | + "cell_type": "code", | |
181 | + "execution_count": 31, | |
182 | + "id": "14443aa6", | |
183 | + "metadata": {}, | |
184 | + "outputs": [ | |
185 | + { | |
186 | + "data": { | |
187 | + "text/plain": [ | |
188 | + "True" | |
189 | + ] | |
190 | + }, | |
191 | + "execution_count": 31, | |
192 | + "metadata": {}, | |
193 | + "output_type": "execute_result" | |
194 | + } | |
195 | + ], | |
196 | + "source": [ | |
197 | + "5 not in [1, 2, 3]" | |
198 | + ] | |
199 | + }, | |
200 | + { | |
201 | + "cell_type": "code", | |
202 | + "execution_count": 32, | |
203 | + "id": "aa212512", | |
204 | + "metadata": {}, | |
205 | + "outputs": [ | |
206 | + { | |
207 | + "data": { | |
208 | + "text/plain": [ | |
209 | + "True" | |
210 | + ] | |
211 | + }, | |
212 | + "execution_count": 32, | |
213 | + "metadata": {}, | |
214 | + "output_type": "execute_result" | |
215 | + } | |
216 | + ], | |
217 | + "source": [ | |
218 | + "'a' in ['a', 'b ', 'c']" | |
219 | + ] | |
220 | + }, | |
221 | + { | |
222 | + "cell_type": "code", | |
223 | + "execution_count": null, | |
224 | + "id": "640a6ce9", | |
225 | + "metadata": {}, | |
226 | + "outputs": [], | |
227 | + "source": [] | |
228 | + } | |
229 | + ], | |
230 | + "metadata": { | |
231 | + "kernelspec": { | |
232 | + "display_name": "Python 3 (ipykernel)", | |
233 | + "language": "python", | |
234 | + "name": "python3" | |
235 | + }, | |
236 | + "language_info": { | |
237 | + "codemirror_mode": { | |
238 | + "name": "ipython", | |
239 | + "version": 3 | |
240 | + }, | |
241 | + "file_extension": ".py", | |
242 | + "mimetype": "text/x-python", | |
243 | + "name": "python", | |
244 | + "nbconvert_exporter": "python", | |
245 | + "pygments_lexer": "ipython3", | |
246 | + "version": "3.10.4" | |
247 | + } | |
248 | + }, | |
249 | + "nbformat": 4, | |
250 | + "nbformat_minor": 5 | |
251 | +} |
+++ 20220411/loop.ipynb
... | ... | @@ -0,0 +1,591 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 1, | |
6 | + "id": "7965fa5b", | |
7 | + "metadata": {}, | |
8 | + "outputs": [ | |
9 | + { | |
10 | + "name": "stdout", | |
11 | + "output_type": "stream", | |
12 | + "text": [ | |
13 | + "*\n", | |
14 | + "**\n", | |
15 | + "***\n", | |
16 | + "****\n", | |
17 | + "*****\n" | |
18 | + ] | |
19 | + } | |
20 | + ], | |
21 | + "source": [ | |
22 | + "i = 0\n", | |
23 | + "while i < 5:\n", | |
24 | + " i += 1\n", | |
25 | + " print('*' * i)" | |
26 | + ] | |
27 | + }, | |
28 | + { | |
29 | + "cell_type": "code", | |
30 | + "execution_count": 2, | |
31 | + "id": "ab4a0ddf", | |
32 | + "metadata": {}, | |
33 | + "outputs": [ | |
34 | + { | |
35 | + "name": "stdout", | |
36 | + "output_type": "stream", | |
37 | + "text": [ | |
38 | + "one\n", | |
39 | + "element length is : 3\n", | |
40 | + "two\n", | |
41 | + "element length is : 3\n", | |
42 | + "three\n", | |
43 | + "element length is : 5\n" | |
44 | + ] | |
45 | + } | |
46 | + ], | |
47 | + "source": [ | |
48 | + "l = ['one', 'two', 'three']\n", | |
49 | + "for i in l:\n", | |
50 | + " print(i)\n", | |
51 | + " print(\"element length is :\", len(i))" | |
52 | + ] | |
53 | + }, | |
54 | + { | |
55 | + "cell_type": "code", | |
56 | + "execution_count": 3, | |
57 | + "id": "d500b4ae", | |
58 | + "metadata": {}, | |
59 | + "outputs": [ | |
60 | + { | |
61 | + "name": "stdout", | |
62 | + "output_type": "stream", | |
63 | + "text": [ | |
64 | + "1번 학생은 합격(90점)입니다.\n", | |
65 | + "2번 학생은 불합격(25점)입니다.\n", | |
66 | + "3번 학생은 합격(60점)입니다.\n", | |
67 | + "4번 학생은 불합격(45점)입니다.\n", | |
68 | + "5번 학생은 합격(93점)입니다.\n" | |
69 | + ] | |
70 | + } | |
71 | + ], | |
72 | + "source": [ | |
73 | + "number = 0\n", | |
74 | + "for score in [90, 25, 60.1, 45, 93]:\n", | |
75 | + " number += 1\n", | |
76 | + " if score >= 60:\n", | |
77 | + " print(\"%d번 학생은 합격(%d점)입니다.\" %(number, score))\n", | |
78 | + " else:\n", | |
79 | + " print(\"%d번 학생은 불합격(%d점)입니다.\" %(number, score))" | |
80 | + ] | |
81 | + }, | |
82 | + { | |
83 | + "cell_type": "code", | |
84 | + "execution_count": 5, | |
85 | + "id": "f692f1bf", | |
86 | + "metadata": {}, | |
87 | + "outputs": [ | |
88 | + { | |
89 | + "name": "stdout", | |
90 | + "output_type": "stream", | |
91 | + "text": [ | |
92 | + "*****\n", | |
93 | + "****\n", | |
94 | + "***\n", | |
95 | + "**\n", | |
96 | + "*\n" | |
97 | + ] | |
98 | + } | |
99 | + ], | |
100 | + "source": [ | |
101 | + "i = 5\n", | |
102 | + "while i > 0:\n", | |
103 | + " print(\"*\" * i)\n", | |
104 | + " i -= 1" | |
105 | + ] | |
106 | + }, | |
107 | + { | |
108 | + "cell_type": "code", | |
109 | + "execution_count": 19, | |
110 | + "id": "b52d9b14", | |
111 | + "metadata": {}, | |
112 | + "outputs": [ | |
113 | + { | |
114 | + "name": "stdout", | |
115 | + "output_type": "stream", | |
116 | + "text": [ | |
117 | + "*\n", | |
118 | + "**\n", | |
119 | + "***\n", | |
120 | + "****\n", | |
121 | + "*****\n" | |
122 | + ] | |
123 | + } | |
124 | + ], | |
125 | + "source": [ | |
126 | + "i = 0\n", | |
127 | + "for i in range(5):\n", | |
128 | + " i += 1\n", | |
129 | + " print(\"*\" * i)" | |
130 | + ] | |
131 | + }, | |
132 | + { | |
133 | + "cell_type": "code", | |
134 | + "execution_count": 24, | |
135 | + "id": "df9bd043", | |
136 | + "metadata": {}, | |
137 | + "outputs": [ | |
138 | + { | |
139 | + "name": "stdout", | |
140 | + "output_type": "stream", | |
141 | + "text": [ | |
142 | + "\n", | |
143 | + "*\n", | |
144 | + "**\n", | |
145 | + "***\n", | |
146 | + "****\n", | |
147 | + "*****\n" | |
148 | + ] | |
149 | + } | |
150 | + ], | |
151 | + "source": [ | |
152 | + "for i in range(0, 6):\n", | |
153 | + " print(\"*\" * i)" | |
154 | + ] | |
155 | + }, | |
156 | + { | |
157 | + "cell_type": "code", | |
158 | + "execution_count": 25, | |
159 | + "id": "e8caf336", | |
160 | + "metadata": {}, | |
161 | + "outputs": [ | |
162 | + { | |
163 | + "name": "stdout", | |
164 | + "output_type": "stream", | |
165 | + "text": [ | |
166 | + "*\n", | |
167 | + "***\n", | |
168 | + "*****\n", | |
169 | + "*******\n", | |
170 | + "*********\n" | |
171 | + ] | |
172 | + } | |
173 | + ], | |
174 | + "source": [ | |
175 | + "for i in range(1, 11, 2):\n", | |
176 | + " print(\"*\" * i)" | |
177 | + ] | |
178 | + }, | |
179 | + { | |
180 | + "cell_type": "code", | |
181 | + "execution_count": 27, | |
182 | + "id": "f75ee029", | |
183 | + "metadata": {}, | |
184 | + "outputs": [ | |
185 | + { | |
186 | + "name": "stdout", | |
187 | + "output_type": "stream", | |
188 | + "text": [ | |
189 | + "*****\n", | |
190 | + "****\n", | |
191 | + "***\n", | |
192 | + "**\n", | |
193 | + "*\n" | |
194 | + ] | |
195 | + } | |
196 | + ], | |
197 | + "source": [ | |
198 | + "i = 5\n", | |
199 | + "while i > 0:\n", | |
200 | + " print(\"*\" * i)\n", | |
201 | + " i -= 1" | |
202 | + ] | |
203 | + }, | |
204 | + { | |
205 | + "cell_type": "code", | |
206 | + "execution_count": 29, | |
207 | + "id": "f2abcb85", | |
208 | + "metadata": {}, | |
209 | + "outputs": [ | |
210 | + { | |
211 | + "name": "stdout", | |
212 | + "output_type": "stream", | |
213 | + "text": [ | |
214 | + "*****\n", | |
215 | + "****\n", | |
216 | + "***\n", | |
217 | + "**\n", | |
218 | + "*\n" | |
219 | + ] | |
220 | + } | |
221 | + ], | |
222 | + "source": [ | |
223 | + "for i in range(5, 0, -1):\n", | |
224 | + " print(\"*\" * i)" | |
225 | + ] | |
226 | + }, | |
227 | + { | |
228 | + "cell_type": "code", | |
229 | + "execution_count": 33, | |
230 | + "id": "fbd0824c", | |
231 | + "metadata": {}, | |
232 | + "outputs": [ | |
233 | + { | |
234 | + "name": "stdout", | |
235 | + "output_type": "stream", | |
236 | + "text": [ | |
237 | + "4\n" | |
238 | + ] | |
239 | + } | |
240 | + ], | |
241 | + "source": [ | |
242 | + "def sum1(a, b):\n", | |
243 | + " x = a + b\n", | |
244 | + " return x\n", | |
245 | + "\n", | |
246 | + "print(sum1(2, 2))" | |
247 | + ] | |
248 | + }, | |
249 | + { | |
250 | + "cell_type": "code", | |
251 | + "execution_count": 37, | |
252 | + "id": "389b2569", | |
253 | + "metadata": {}, | |
254 | + "outputs": [ | |
255 | + { | |
256 | + "data": { | |
257 | + "text/plain": [ | |
258 | + "9" | |
259 | + ] | |
260 | + }, | |
261 | + "execution_count": 37, | |
262 | + "metadata": {}, | |
263 | + "output_type": "execute_result" | |
264 | + } | |
265 | + ], | |
266 | + "source": [ | |
267 | + "def sum3(*args):\n", | |
268 | + " x = 0\n", | |
269 | + " for i in args:\n", | |
270 | + " x += i\n", | |
271 | + " return x\n", | |
272 | + "sum3(3, 3, 3)" | |
273 | + ] | |
274 | + }, | |
275 | + { | |
276 | + "cell_type": "code", | |
277 | + "execution_count": 50, | |
278 | + "id": "5f9d182a", | |
279 | + "metadata": {}, | |
280 | + "outputs": [], | |
281 | + "source": [ | |
282 | + "def star(*args):\n", | |
283 | + " for i in args:\n", | |
284 | + " print(\"*\" * i)" | |
285 | + ] | |
286 | + }, | |
287 | + { | |
288 | + "cell_type": "code", | |
289 | + "execution_count": 51, | |
290 | + "id": "d0a32e25", | |
291 | + "metadata": {}, | |
292 | + "outputs": [ | |
293 | + { | |
294 | + "name": "stdout", | |
295 | + "output_type": "stream", | |
296 | + "text": [ | |
297 | + "*****\n", | |
298 | + "***\n", | |
299 | + "**\n", | |
300 | + "******************************************************\n", | |
301 | + "****\n" | |
302 | + ] | |
303 | + } | |
304 | + ], | |
305 | + "source": [ | |
306 | + "star(5, 3, 2, 54, 4)" | |
307 | + ] | |
308 | + }, | |
309 | + { | |
310 | + "cell_type": "code", | |
311 | + "execution_count": 52, | |
312 | + "id": "3aa6e066", | |
313 | + "metadata": {}, | |
314 | + "outputs": [], | |
315 | + "source": [ | |
316 | + "# internal function" | |
317 | + ] | |
318 | + }, | |
319 | + { | |
320 | + "cell_type": "code", | |
321 | + "execution_count": 54, | |
322 | + "id": "67bad3f1", | |
323 | + "metadata": {}, | |
324 | + "outputs": [ | |
325 | + { | |
326 | + "data": { | |
327 | + "text/plain": [ | |
328 | + "3" | |
329 | + ] | |
330 | + }, | |
331 | + "execution_count": 54, | |
332 | + "metadata": {}, | |
333 | + "output_type": "execute_result" | |
334 | + } | |
335 | + ], | |
336 | + "source": [ | |
337 | + "abs(-3) # absolute" | |
338 | + ] | |
339 | + }, | |
340 | + { | |
341 | + "cell_type": "code", | |
342 | + "execution_count": 59, | |
343 | + "id": "9da6a225", | |
344 | + "metadata": {}, | |
345 | + "outputs": [ | |
346 | + { | |
347 | + "data": { | |
348 | + "text/plain": [ | |
349 | + "True" | |
350 | + ] | |
351 | + }, | |
352 | + "execution_count": 59, | |
353 | + "metadata": {}, | |
354 | + "output_type": "execute_result" | |
355 | + } | |
356 | + ], | |
357 | + "source": [ | |
358 | + "all([1, 2, 3, 4])" | |
359 | + ] | |
360 | + }, | |
361 | + { | |
362 | + "cell_type": "code", | |
363 | + "execution_count": 61, | |
364 | + "id": "66433eb0", | |
365 | + "metadata": {}, | |
366 | + "outputs": [ | |
367 | + { | |
368 | + "data": { | |
369 | + "text/plain": [ | |
370 | + "True" | |
371 | + ] | |
372 | + }, | |
373 | + "execution_count": 61, | |
374 | + "metadata": {}, | |
375 | + "output_type": "execute_result" | |
376 | + } | |
377 | + ], | |
378 | + "source": [ | |
379 | + "any([0, 0, 0, 0, 0, 1])" | |
380 | + ] | |
381 | + }, | |
382 | + { | |
383 | + "cell_type": "code", | |
384 | + "execution_count": 65, | |
385 | + "id": "fe4d4119", | |
386 | + "metadata": {}, | |
387 | + "outputs": [ | |
388 | + { | |
389 | + "data": { | |
390 | + "text/plain": [ | |
391 | + "'a'" | |
392 | + ] | |
393 | + }, | |
394 | + "execution_count": 65, | |
395 | + "metadata": {}, | |
396 | + "output_type": "execute_result" | |
397 | + } | |
398 | + ], | |
399 | + "source": [ | |
400 | + "chr(97)" | |
401 | + ] | |
402 | + }, | |
403 | + { | |
404 | + "cell_type": "code", | |
405 | + "execution_count": 66, | |
406 | + "id": "8238d660", | |
407 | + "metadata": {}, | |
408 | + "outputs": [ | |
409 | + { | |
410 | + "data": { | |
411 | + "text/plain": [ | |
412 | + "97" | |
413 | + ] | |
414 | + }, | |
415 | + "execution_count": 66, | |
416 | + "metadata": {}, | |
417 | + "output_type": "execute_result" | |
418 | + } | |
419 | + ], | |
420 | + "source": [ | |
421 | + "ord('a')" | |
422 | + ] | |
423 | + }, | |
424 | + { | |
425 | + "cell_type": "code", | |
426 | + "execution_count": 76, | |
427 | + "id": "2c356f2a", | |
428 | + "metadata": {}, | |
429 | + "outputs": [ | |
430 | + { | |
431 | + "data": { | |
432 | + "text/plain": [ | |
433 | + "1" | |
434 | + ] | |
435 | + }, | |
436 | + "execution_count": 76, | |
437 | + "metadata": {}, | |
438 | + "output_type": "execute_result" | |
439 | + } | |
440 | + ], | |
441 | + "source": [ | |
442 | + "a = 1\n", | |
443 | + "a.real" | |
444 | + ] | |
445 | + }, | |
446 | + { | |
447 | + "cell_type": "code", | |
448 | + "execution_count": 78, | |
449 | + "id": "5bda70d3", | |
450 | + "metadata": {}, | |
451 | + "outputs": [ | |
452 | + { | |
453 | + "data": { | |
454 | + "text/plain": [ | |
455 | + "(2, 1)" | |
456 | + ] | |
457 | + }, | |
458 | + "execution_count": 78, | |
459 | + "metadata": {}, | |
460 | + "output_type": "execute_result" | |
461 | + } | |
462 | + ], | |
463 | + "source": [ | |
464 | + "divmod(7, 3)" | |
465 | + ] | |
466 | + }, | |
467 | + { | |
468 | + "cell_type": "code", | |
469 | + "execution_count": 84, | |
470 | + "id": "c389c244", | |
471 | + "metadata": {}, | |
472 | + "outputs": [ | |
473 | + { | |
474 | + "data": { | |
475 | + "text/plain": [ | |
476 | + "6" | |
477 | + ] | |
478 | + }, | |
479 | + "execution_count": 84, | |
480 | + "metadata": {}, | |
481 | + "output_type": "execute_result" | |
482 | + } | |
483 | + ], | |
484 | + "source": [ | |
485 | + "sum = lambda a,b: a+b # anonymous function\n", | |
486 | + "sum(2, 4)" | |
487 | + ] | |
488 | + }, | |
489 | + { | |
490 | + "cell_type": "code", | |
491 | + "execution_count": null, | |
492 | + "id": "a1776047", | |
493 | + "metadata": {}, | |
494 | + "outputs": [], | |
495 | + "source": [] | |
496 | + }, | |
497 | + { | |
498 | + "cell_type": "code", | |
499 | + "execution_count": null, | |
500 | + "id": "b2c9465e", | |
501 | + "metadata": {}, | |
502 | + "outputs": [], | |
503 | + "source": [] | |
504 | + }, | |
505 | + { | |
506 | + "cell_type": "code", | |
507 | + "execution_count": null, | |
508 | + "id": "7c2639a8", | |
509 | + "metadata": {}, | |
510 | + "outputs": [], | |
511 | + "source": [] | |
512 | + }, | |
513 | + { | |
514 | + "cell_type": "code", | |
515 | + "execution_count": null, | |
516 | + "id": "bed9db87", | |
517 | + "metadata": {}, | |
518 | + "outputs": [], | |
519 | + "source": [] | |
520 | + }, | |
521 | + { | |
522 | + "cell_type": "code", | |
523 | + "execution_count": null, | |
524 | + "id": "66ea3e0c", | |
525 | + "metadata": {}, | |
526 | + "outputs": [], | |
527 | + "source": [] | |
528 | + }, | |
529 | + { | |
530 | + "cell_type": "code", | |
531 | + "execution_count": null, | |
532 | + "id": "91cd5457", | |
533 | + "metadata": {}, | |
534 | + "outputs": [], | |
535 | + "source": [] | |
536 | + }, | |
537 | + { | |
538 | + "cell_type": "code", | |
539 | + "execution_count": null, | |
540 | + "id": "eeff7c14", | |
541 | + "metadata": {}, | |
542 | + "outputs": [], | |
543 | + "source": [] | |
544 | + }, | |
545 | + { | |
546 | + "cell_type": "code", | |
547 | + "execution_count": null, | |
548 | + "id": "d3c5d49a", | |
549 | + "metadata": {}, | |
550 | + "outputs": [], | |
551 | + "source": [] | |
552 | + }, | |
553 | + { | |
554 | + "cell_type": "code", | |
555 | + "execution_count": null, | |
556 | + "id": "c65732e9", | |
557 | + "metadata": {}, | |
558 | + "outputs": [], | |
559 | + "source": [] | |
560 | + }, | |
561 | + { | |
562 | + "cell_type": "code", | |
563 | + "execution_count": null, | |
564 | + "id": "9f4f90c7", | |
565 | + "metadata": {}, | |
566 | + "outputs": [], | |
567 | + "source": [] | |
568 | + } | |
569 | + ], | |
570 | + "metadata": { | |
571 | + "kernelspec": { | |
572 | + "display_name": "Python 3 (ipykernel)", | |
573 | + "language": "python", | |
574 | + "name": "python3" | |
575 | + }, | |
576 | + "language_info": { | |
577 | + "codemirror_mode": { | |
578 | + "name": "ipython", | |
579 | + "version": 3 | |
580 | + }, | |
581 | + "file_extension": ".py", | |
582 | + "mimetype": "text/x-python", | |
583 | + "name": "python", | |
584 | + "nbconvert_exporter": "python", | |
585 | + "pygments_lexer": "ipython3", | |
586 | + "version": "3.10.4" | |
587 | + } | |
588 | + }, | |
589 | + "nbformat": 4, | |
590 | + "nbformat_minor": 5 | |
591 | +} |
+++ 20220418/.ipynb_checkpoints/DataFramee-checkpoint.ipynb
... | ... | @@ -0,0 +1,502 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 1, | |
6 | + "id": "2488d73e", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import pandas as pd" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 2, | |
16 | + "id": "5923b769", | |
17 | + "metadata": {}, | |
18 | + "outputs": [ | |
19 | + { | |
20 | + "data": { | |
21 | + "text/plain": [ | |
22 | + "{'year': [2018, 2019, 2020], 'sales': [350, 480, 1099]}" | |
23 | + ] | |
24 | + }, | |
25 | + "execution_count": 2, | |
26 | + "metadata": {}, | |
27 | + "output_type": "execute_result" | |
28 | + } | |
29 | + ], | |
30 | + "source": [ | |
31 | + "data_dic = {\n", | |
32 | + " 'year' : [2018, 2019, 2020],\n", | |
33 | + " 'sales' : [350, 480, 1099]\n", | |
34 | + "}\n", | |
35 | + "data_dic" | |
36 | + ] | |
37 | + }, | |
38 | + { | |
39 | + "cell_type": "code", | |
40 | + "execution_count": 4, | |
41 | + "id": "1919e60b", | |
42 | + "metadata": {}, | |
43 | + "outputs": [ | |
44 | + { | |
45 | + "data": { | |
46 | + "text/plain": [ | |
47 | + "year [2018, 2019, 2020]\n", | |
48 | + "sales [350, 480, 1099]\n", | |
49 | + "dtype: object" | |
50 | + ] | |
51 | + }, | |
52 | + "execution_count": 4, | |
53 | + "metadata": {}, | |
54 | + "output_type": "execute_result" | |
55 | + } | |
56 | + ], | |
57 | + "source": [ | |
58 | + "ds = pd.Series(data_dic)\n", | |
59 | + "ds" | |
60 | + ] | |
61 | + }, | |
62 | + { | |
63 | + "cell_type": "code", | |
64 | + "execution_count": 6, | |
65 | + "id": "dd46a777", | |
66 | + "metadata": {}, | |
67 | + "outputs": [ | |
68 | + { | |
69 | + "data": { | |
70 | + "text/html": [ | |
71 | + "<div>\n", | |
72 | + "<style scoped>\n", | |
73 | + " .dataframe tbody tr th:only-of-type {\n", | |
74 | + " vertical-align: middle;\n", | |
75 | + " }\n", | |
76 | + "\n", | |
77 | + " .dataframe tbody tr th {\n", | |
78 | + " vertical-align: top;\n", | |
79 | + " }\n", | |
80 | + "\n", | |
81 | + " .dataframe thead th {\n", | |
82 | + " text-align: right;\n", | |
83 | + " }\n", | |
84 | + "</style>\n", | |
85 | + "<table border=\"1\" class=\"dataframe\">\n", | |
86 | + " <thead>\n", | |
87 | + " <tr style=\"text-align: right;\">\n", | |
88 | + " <th></th>\n", | |
89 | + " <th>year</th>\n", | |
90 | + " <th>sales</th>\n", | |
91 | + " </tr>\n", | |
92 | + " </thead>\n", | |
93 | + " <tbody>\n", | |
94 | + " <tr>\n", | |
95 | + " <th>0</th>\n", | |
96 | + " <td>2018</td>\n", | |
97 | + " <td>350</td>\n", | |
98 | + " </tr>\n", | |
99 | + " <tr>\n", | |
100 | + " <th>1</th>\n", | |
101 | + " <td>2019</td>\n", | |
102 | + " <td>480</td>\n", | |
103 | + " </tr>\n", | |
104 | + " <tr>\n", | |
105 | + " <th>2</th>\n", | |
106 | + " <td>2020</td>\n", | |
107 | + " <td>1099</td>\n", | |
108 | + " </tr>\n", | |
109 | + " </tbody>\n", | |
110 | + "</table>\n", | |
111 | + "</div>" | |
112 | + ], | |
113 | + "text/plain": [ | |
114 | + " year sales\n", | |
115 | + "0 2018 350\n", | |
116 | + "1 2019 480\n", | |
117 | + "2 2020 1099" | |
118 | + ] | |
119 | + }, | |
120 | + "execution_count": 6, | |
121 | + "metadata": {}, | |
122 | + "output_type": "execute_result" | |
123 | + } | |
124 | + ], | |
125 | + "source": [ | |
126 | + "df1 = pd.DataFrame(data_dic)\n", | |
127 | + "df1" | |
128 | + ] | |
129 | + }, | |
130 | + { | |
131 | + "cell_type": "code", | |
132 | + "execution_count": 7, | |
133 | + "id": "14e8c8e5", | |
134 | + "metadata": {}, | |
135 | + "outputs": [ | |
136 | + { | |
137 | + "data": { | |
138 | + "text/html": [ | |
139 | + "<div>\n", | |
140 | + "<style scoped>\n", | |
141 | + " .dataframe tbody tr th:only-of-type {\n", | |
142 | + " vertical-align: middle;\n", | |
143 | + " }\n", | |
144 | + "\n", | |
145 | + " .dataframe tbody tr th {\n", | |
146 | + " vertical-align: top;\n", | |
147 | + " }\n", | |
148 | + "\n", | |
149 | + " .dataframe thead th {\n", | |
150 | + " text-align: right;\n", | |
151 | + " }\n", | |
152 | + "</style>\n", | |
153 | + "<table border=\"1\" class=\"dataframe\">\n", | |
154 | + " <thead>\n", | |
155 | + " <tr style=\"text-align: right;\">\n", | |
156 | + " <th></th>\n", | |
157 | + " <th>sales</th>\n", | |
158 | + " </tr>\n", | |
159 | + " <tr>\n", | |
160 | + " <th>year</th>\n", | |
161 | + " <th></th>\n", | |
162 | + " </tr>\n", | |
163 | + " </thead>\n", | |
164 | + " <tbody>\n", | |
165 | + " <tr>\n", | |
166 | + " <th>2018</th>\n", | |
167 | + " <td>350</td>\n", | |
168 | + " </tr>\n", | |
169 | + " <tr>\n", | |
170 | + " <th>2019</th>\n", | |
171 | + " <td>480</td>\n", | |
172 | + " </tr>\n", | |
173 | + " <tr>\n", | |
174 | + " <th>2020</th>\n", | |
175 | + " <td>1099</td>\n", | |
176 | + " </tr>\n", | |
177 | + " </tbody>\n", | |
178 | + "</table>\n", | |
179 | + "</div>" | |
180 | + ], | |
181 | + "text/plain": [ | |
182 | + " sales\n", | |
183 | + "year \n", | |
184 | + "2018 350\n", | |
185 | + "2019 480\n", | |
186 | + "2020 1099" | |
187 | + ] | |
188 | + }, | |
189 | + "execution_count": 7, | |
190 | + "metadata": {}, | |
191 | + "output_type": "execute_result" | |
192 | + } | |
193 | + ], | |
194 | + "source": [ | |
195 | + "df1.set_index('year')" | |
196 | + ] | |
197 | + }, | |
198 | + { | |
199 | + "cell_type": "code", | |
200 | + "execution_count": 10, | |
201 | + "id": "6f0a64c7", | |
202 | + "metadata": {}, | |
203 | + "outputs": [ | |
204 | + { | |
205 | + "data": { | |
206 | + "text/html": [ | |
207 | + "<div>\n", | |
208 | + "<style scoped>\n", | |
209 | + " .dataframe tbody tr th:only-of-type {\n", | |
210 | + " vertical-align: middle;\n", | |
211 | + " }\n", | |
212 | + "\n", | |
213 | + " .dataframe tbody tr th {\n", | |
214 | + " vertical-align: top;\n", | |
215 | + " }\n", | |
216 | + "\n", | |
217 | + " .dataframe thead th {\n", | |
218 | + " text-align: right;\n", | |
219 | + " }\n", | |
220 | + "</style>\n", | |
221 | + "<table border=\"1\" class=\"dataframe\">\n", | |
222 | + " <thead>\n", | |
223 | + " <tr style=\"text-align: right;\">\n", | |
224 | + " <th></th>\n", | |
225 | + " <th>1반</th>\n", | |
226 | + " <th>2반</th>\n", | |
227 | + " <th>3반</th>\n", | |
228 | + " </tr>\n", | |
229 | + " </thead>\n", | |
230 | + " <tbody>\n", | |
231 | + " <tr>\n", | |
232 | + " <th>중간고사</th>\n", | |
233 | + " <td>89.2</td>\n", | |
234 | + " <td>92.5</td>\n", | |
235 | + " <td>90.8</td>\n", | |
236 | + " </tr>\n", | |
237 | + " <tr>\n", | |
238 | + " <th>기말고사</th>\n", | |
239 | + " <td>92.8</td>\n", | |
240 | + " <td>89.9</td>\n", | |
241 | + " <td>95.2</td>\n", | |
242 | + " </tr>\n", | |
243 | + " </tbody>\n", | |
244 | + "</table>\n", | |
245 | + "</div>" | |
246 | + ], | |
247 | + "text/plain": [ | |
248 | + " 1반 2반 3반\n", | |
249 | + "중간고사 89.2 92.5 90.8\n", | |
250 | + "기말고사 92.8 89.9 95.2" | |
251 | + ] | |
252 | + }, | |
253 | + "execution_count": 10, | |
254 | + "metadata": {}, | |
255 | + "output_type": "execute_result" | |
256 | + } | |
257 | + ], | |
258 | + "source": [ | |
259 | + "data2 = ['1반', '2반', '3반']\n", | |
260 | + "df2 = pd.DataFrame([[89.2, 92.5, 90.8], [92.8, 89.9, 95.2]], index = ['중간고사', '기말고사'], columns = data2[0:3])\n", | |
261 | + "df2" | |
262 | + ] | |
263 | + }, | |
264 | + { | |
265 | + "cell_type": "code", | |
266 | + "execution_count": 11, | |
267 | + "id": "a1ea90d8", | |
268 | + "metadata": {}, | |
269 | + "outputs": [], | |
270 | + "source": [ | |
271 | + "df1 = pd.DataFrame([[89.2, 92.5, 90.8], [92.8, 89.9, 95.2]])" | |
272 | + ] | |
273 | + }, | |
274 | + { | |
275 | + "cell_type": "code", | |
276 | + "execution_count": 12, | |
277 | + "id": "db0b10ea", | |
278 | + "metadata": {}, | |
279 | + "outputs": [ | |
280 | + { | |
281 | + "data": { | |
282 | + "text/html": [ | |
283 | + "<div>\n", | |
284 | + "<style scoped>\n", | |
285 | + " .dataframe tbody tr th:only-of-type {\n", | |
286 | + " vertical-align: middle;\n", | |
287 | + " }\n", | |
288 | + "\n", | |
289 | + " .dataframe tbody tr th {\n", | |
290 | + " vertical-align: top;\n", | |
291 | + " }\n", | |
292 | + "\n", | |
293 | + " .dataframe thead th {\n", | |
294 | + " text-align: right;\n", | |
295 | + " }\n", | |
296 | + "</style>\n", | |
297 | + "<table border=\"1\" class=\"dataframe\">\n", | |
298 | + " <thead>\n", | |
299 | + " <tr style=\"text-align: right;\">\n", | |
300 | + " <th></th>\n", | |
301 | + " <th>0</th>\n", | |
302 | + " <th>1</th>\n", | |
303 | + " <th>2</th>\n", | |
304 | + " </tr>\n", | |
305 | + " </thead>\n", | |
306 | + " <tbody>\n", | |
307 | + " <tr>\n", | |
308 | + " <th>0</th>\n", | |
309 | + " <td>89.2</td>\n", | |
310 | + " <td>92.5</td>\n", | |
311 | + " <td>90.8</td>\n", | |
312 | + " </tr>\n", | |
313 | + " <tr>\n", | |
314 | + " <th>1</th>\n", | |
315 | + " <td>92.8</td>\n", | |
316 | + " <td>89.9</td>\n", | |
317 | + " <td>95.2</td>\n", | |
318 | + " </tr>\n", | |
319 | + " </tbody>\n", | |
320 | + "</table>\n", | |
321 | + "</div>" | |
322 | + ], | |
323 | + "text/plain": [ | |
324 | + " 0 1 2\n", | |
325 | + "0 89.2 92.5 90.8\n", | |
326 | + "1 92.8 89.9 95.2" | |
327 | + ] | |
328 | + }, | |
329 | + "execution_count": 12, | |
330 | + "metadata": {}, | |
331 | + "output_type": "execute_result" | |
332 | + } | |
333 | + ], | |
334 | + "source": [ | |
335 | + "df1" | |
336 | + ] | |
337 | + }, | |
338 | + { | |
339 | + "cell_type": "code", | |
340 | + "execution_count": 13, | |
341 | + "id": "0deb3702", | |
342 | + "metadata": {}, | |
343 | + "outputs": [], | |
344 | + "source": [ | |
345 | + "df1.columns = {1, 2, 3}" | |
346 | + ] | |
347 | + }, | |
348 | + { | |
349 | + "cell_type": "code", | |
350 | + "execution_count": 15, | |
351 | + "id": "069b808e", | |
352 | + "metadata": {}, | |
353 | + "outputs": [], | |
354 | + "source": [ | |
355 | + "df1.index = {'middle', 'final'}" | |
356 | + ] | |
357 | + }, | |
358 | + { | |
359 | + "cell_type": "code", | |
360 | + "execution_count": 16, | |
361 | + "id": "9ee94d2c", | |
362 | + "metadata": {}, | |
363 | + "outputs": [ | |
364 | + { | |
365 | + "data": { | |
366 | + "text/html": [ | |
367 | + "<div>\n", | |
368 | + "<style scoped>\n", | |
369 | + " .dataframe tbody tr th:only-of-type {\n", | |
370 | + " vertical-align: middle;\n", | |
371 | + " }\n", | |
372 | + "\n", | |
373 | + " .dataframe tbody tr th {\n", | |
374 | + " vertical-align: top;\n", | |
375 | + " }\n", | |
376 | + "\n", | |
377 | + " .dataframe thead th {\n", | |
378 | + " text-align: right;\n", | |
379 | + " }\n", | |
380 | + "</style>\n", | |
381 | + "<table border=\"1\" class=\"dataframe\">\n", | |
382 | + " <thead>\n", | |
383 | + " <tr style=\"text-align: right;\">\n", | |
384 | + " <th></th>\n", | |
385 | + " <th>1</th>\n", | |
386 | + " <th>2</th>\n", | |
387 | + " <th>3</th>\n", | |
388 | + " </tr>\n", | |
389 | + " </thead>\n", | |
390 | + " <tbody>\n", | |
391 | + " <tr>\n", | |
392 | + " <th>middle</th>\n", | |
393 | + " <td>89.2</td>\n", | |
394 | + " <td>92.5</td>\n", | |
395 | + " <td>90.8</td>\n", | |
396 | + " </tr>\n", | |
397 | + " <tr>\n", | |
398 | + " <th>final</th>\n", | |
399 | + " <td>92.8</td>\n", | |
400 | + " <td>89.9</td>\n", | |
401 | + " <td>95.2</td>\n", | |
402 | + " </tr>\n", | |
403 | + " </tbody>\n", | |
404 | + "</table>\n", | |
405 | + "</div>" | |
406 | + ], | |
407 | + "text/plain": [ | |
408 | + " 1 2 3\n", | |
409 | + "middle 89.2 92.5 90.8\n", | |
410 | + "final 92.8 89.9 95.2" | |
411 | + ] | |
412 | + }, | |
413 | + "execution_count": 16, | |
414 | + "metadata": {}, | |
415 | + "output_type": "execute_result" | |
416 | + } | |
417 | + ], | |
418 | + "source": [ | |
419 | + "df1" | |
420 | + ] | |
421 | + }, | |
422 | + { | |
423 | + "cell_type": "code", | |
424 | + "execution_count": 20, | |
425 | + "id": "8cdb7b5f", | |
426 | + "metadata": {}, | |
427 | + "outputs": [], | |
428 | + "source": [ | |
429 | + "df1.to_csv('C:/Users/pc/dev/20220418/score.csv')" | |
430 | + ] | |
431 | + }, | |
432 | + { | |
433 | + "cell_type": "code", | |
434 | + "execution_count": 21, | |
435 | + "id": "d7b41ef1", | |
436 | + "metadata": {}, | |
437 | + "outputs": [], | |
438 | + "source": [ | |
439 | + "df1.to_csv('C:/Users/pc/dev/20220418/score2.csv', header='False')" | |
440 | + ] | |
441 | + }, | |
442 | + { | |
443 | + "cell_type": "code", | |
444 | + "execution_count": 22, | |
445 | + "id": "971fd233", | |
446 | + "metadata": {}, | |
447 | + "outputs": [], | |
448 | + "source": [ | |
449 | + "df1.to_csv('C:/Users/pc/dev/20220418/score3.csv', encoding='utf-8')" | |
450 | + ] | |
451 | + }, | |
452 | + { | |
453 | + "cell_type": "code", | |
454 | + "execution_count": 23, | |
455 | + "id": "a3539477", | |
456 | + "metadata": {}, | |
457 | + "outputs": [], | |
458 | + "source": [ | |
459 | + "df1.to_csv('C:/Users/pc/dev/20220418/score4.csv', encoding='euc-kr')" | |
460 | + ] | |
461 | + }, | |
462 | + { | |
463 | + "cell_type": "code", | |
464 | + "execution_count": 24, | |
465 | + "id": "66613fcc", | |
466 | + "metadata": {}, | |
467 | + "outputs": [], | |
468 | + "source": [ | |
469 | + "df1.to_csv('C:/Users/pc/dev/20220418/score5.csv', encoding='ms949')" | |
470 | + ] | |
471 | + }, | |
472 | + { | |
473 | + "cell_type": "code", | |
474 | + "execution_count": null, | |
475 | + "id": "6c64e3d3", | |
476 | + "metadata": {}, | |
477 | + "outputs": [], | |
478 | + "source": [] | |
479 | + } | |
480 | + ], | |
481 | + "metadata": { | |
482 | + "kernelspec": { | |
483 | + "display_name": "Python 3 (ipykernel)", | |
484 | + "language": "python", | |
485 | + "name": "python3" | |
486 | + }, | |
487 | + "language_info": { | |
488 | + "codemirror_mode": { | |
489 | + "name": "ipython", | |
490 | + "version": 3 | |
491 | + }, | |
492 | + "file_extension": ".py", | |
493 | + "mimetype": "text/x-python", | |
494 | + "name": "python", | |
495 | + "nbconvert_exporter": "python", | |
496 | + "pygments_lexer": "ipython3", | |
497 | + "version": "3.9.7" | |
498 | + } | |
499 | + }, | |
500 | + "nbformat": 4, | |
501 | + "nbformat_minor": 5 | |
502 | +} |
+++ 20220418/.ipynb_checkpoints/Matplotlib-checkpoint.ipynb
... | ... | @@ -0,0 +1,6 @@ |
1 | +{ | |
2 | + "cells": [], | |
3 | + "metadata": {}, | |
4 | + "nbformat": 4, | |
5 | + "nbformat_minor": 5 | |
6 | +} |
+++ 20220418/.ipynb_checkpoints/numpy-checkpoint.ipynb
... | ... | @@ -0,0 +1,262 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 5, | |
6 | + "id": "4a18b98a", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import numpy as np" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 11, | |
16 | + "id": "0c3e1e30", | |
17 | + "metadata": {}, | |
18 | + "outputs": [ | |
19 | + { | |
20 | + "data": { | |
21 | + "text/plain": [ | |
22 | + "'1.20.3'" | |
23 | + ] | |
24 | + }, | |
25 | + "execution_count": 11, | |
26 | + "metadata": {}, | |
27 | + "output_type": "execute_result" | |
28 | + } | |
29 | + ], | |
30 | + "source": [ | |
31 | + "np.__version__" | |
32 | + ] | |
33 | + }, | |
34 | + { | |
35 | + "cell_type": "code", | |
36 | + "execution_count": 24, | |
37 | + "id": "e3b36b1f", | |
38 | + "metadata": {}, | |
39 | + "outputs": [ | |
40 | + { | |
41 | + "data": { | |
42 | + "text/plain": [ | |
43 | + "numpy.ndarray" | |
44 | + ] | |
45 | + }, | |
46 | + "execution_count": 24, | |
47 | + "metadata": {}, | |
48 | + "output_type": "execute_result" | |
49 | + } | |
50 | + ], | |
51 | + "source": [ | |
52 | + "ar1 = np.array([1, 2, 3, 4, 5])\n", | |
53 | + "type(ar1)" | |
54 | + ] | |
55 | + }, | |
56 | + { | |
57 | + "cell_type": "code", | |
58 | + "execution_count": 28, | |
59 | + "id": "d3fd2749", | |
60 | + "metadata": {}, | |
61 | + "outputs": [ | |
62 | + { | |
63 | + "data": { | |
64 | + "text/plain": [ | |
65 | + "list" | |
66 | + ] | |
67 | + }, | |
68 | + "execution_count": 28, | |
69 | + "metadata": {}, | |
70 | + "output_type": "execute_result" | |
71 | + } | |
72 | + ], | |
73 | + "source": [ | |
74 | + "list1 = [[10, 20 ,30], [40, 50, 60]]\n", | |
75 | + "type(list1)" | |
76 | + ] | |
77 | + }, | |
78 | + { | |
79 | + "cell_type": "code", | |
80 | + "execution_count": 29, | |
81 | + "id": "f6817fb2", | |
82 | + "metadata": {}, | |
83 | + "outputs": [ | |
84 | + { | |
85 | + "data": { | |
86 | + "text/plain": [ | |
87 | + "array([[10, 20, 30],\n", | |
88 | + " [40, 50, 60]])" | |
89 | + ] | |
90 | + }, | |
91 | + "execution_count": 29, | |
92 | + "metadata": {}, | |
93 | + "output_type": "execute_result" | |
94 | + } | |
95 | + ], | |
96 | + "source": [ | |
97 | + "ar2 = np.array(list1)\n", | |
98 | + "ar2" | |
99 | + ] | |
100 | + }, | |
101 | + { | |
102 | + "cell_type": "code", | |
103 | + "execution_count": 30, | |
104 | + "id": "734954ee", | |
105 | + "metadata": {}, | |
106 | + "outputs": [ | |
107 | + { | |
108 | + "data": { | |
109 | + "text/plain": [ | |
110 | + "array([1, 3, 5, 7, 9])" | |
111 | + ] | |
112 | + }, | |
113 | + "execution_count": 30, | |
114 | + "metadata": {}, | |
115 | + "output_type": "execute_result" | |
116 | + } | |
117 | + ], | |
118 | + "source": [ | |
119 | + "ar3 = np.arange(1, 11, 2)\n", | |
120 | + "ar3" | |
121 | + ] | |
122 | + }, | |
123 | + { | |
124 | + "cell_type": "code", | |
125 | + "execution_count": 43, | |
126 | + "id": "9288e528", | |
127 | + "metadata": {}, | |
128 | + "outputs": [ | |
129 | + { | |
130 | + "data": { | |
131 | + "text/plain": [ | |
132 | + "array([ 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26,\n", | |
133 | + " 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52,\n", | |
134 | + " 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78,\n", | |
135 | + " 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100])" | |
136 | + ] | |
137 | + }, | |
138 | + "execution_count": 43, | |
139 | + "metadata": {}, | |
140 | + "output_type": "execute_result" | |
141 | + } | |
142 | + ], | |
143 | + "source": [ | |
144 | + "ar3_1 = np.arange(2, 101, 2)\n", | |
145 | + "ar3_1" | |
146 | + ] | |
147 | + }, | |
148 | + { | |
149 | + "cell_type": "code", | |
150 | + "execution_count": 45, | |
151 | + "id": "55f5ed5e", | |
152 | + "metadata": {}, | |
153 | + "outputs": [ | |
154 | + { | |
155 | + "data": { | |
156 | + "text/plain": [ | |
157 | + "array([[1, 2],\n", | |
158 | + " [3, 4],\n", | |
159 | + " [5, 6]])" | |
160 | + ] | |
161 | + }, | |
162 | + "execution_count": 45, | |
163 | + "metadata": {}, | |
164 | + "output_type": "execute_result" | |
165 | + } | |
166 | + ], | |
167 | + "source": [ | |
168 | + "ar4 = np.array([1, 2, 3, 4, 5, 6]).reshape((3, 2))\n", | |
169 | + "ar4" | |
170 | + ] | |
171 | + }, | |
172 | + { | |
173 | + "cell_type": "code", | |
174 | + "execution_count": 32, | |
175 | + "id": "e2888e7c", | |
176 | + "metadata": {}, | |
177 | + "outputs": [ | |
178 | + { | |
179 | + "data": { | |
180 | + "text/plain": [ | |
181 | + "array([[0., 0., 0.],\n", | |
182 | + " [0., 0., 0.]])" | |
183 | + ] | |
184 | + }, | |
185 | + "execution_count": 32, | |
186 | + "metadata": {}, | |
187 | + "output_type": "execute_result" | |
188 | + } | |
189 | + ], | |
190 | + "source": [ | |
191 | + "ar5 = np.zeros((2, 3))\n", | |
192 | + "ar5" | |
193 | + ] | |
194 | + }, | |
195 | + { | |
196 | + "cell_type": "code", | |
197 | + "execution_count": 46, | |
198 | + "id": "833867ef", | |
199 | + "metadata": {}, | |
200 | + "outputs": [ | |
201 | + { | |
202 | + "data": { | |
203 | + "text/plain": [ | |
204 | + "array([[10, 20],\n", | |
205 | + " [40, 50]])" | |
206 | + ] | |
207 | + }, | |
208 | + "execution_count": 46, | |
209 | + "metadata": {}, | |
210 | + "output_type": "execute_result" | |
211 | + } | |
212 | + ], | |
213 | + "source": [ | |
214 | + "ar6 = ar2[0:2, 0:2]\n", | |
215 | + "ar6" | |
216 | + ] | |
217 | + }, | |
218 | + { | |
219 | + "cell_type": "code", | |
220 | + "execution_count": 47, | |
221 | + "id": "3e9d7308", | |
222 | + "metadata": {}, | |
223 | + "outputs": [ | |
224 | + { | |
225 | + "data": { | |
226 | + "text/plain": [ | |
227 | + "array([10, 20, 30])" | |
228 | + ] | |
229 | + }, | |
230 | + "execution_count": 47, | |
231 | + "metadata": {}, | |
232 | + "output_type": "execute_result" | |
233 | + } | |
234 | + ], | |
235 | + "source": [ | |
236 | + "ar7 = ar2[0, :]\n", | |
237 | + "ar7" | |
238 | + ] | |
239 | + } | |
240 | + ], | |
241 | + "metadata": { | |
242 | + "kernelspec": { | |
243 | + "display_name": "Python 3 (ipykernel)", | |
244 | + "language": "python", | |
245 | + "name": "python3" | |
246 | + }, | |
247 | + "language_info": { | |
248 | + "codemirror_mode": { | |
249 | + "name": "ipython", | |
250 | + "version": 3 | |
251 | + }, | |
252 | + "file_extension": ".py", | |
253 | + "mimetype": "text/x-python", | |
254 | + "name": "python", | |
255 | + "nbconvert_exporter": "python", | |
256 | + "pygments_lexer": "ipython3", | |
257 | + "version": "3.9.7" | |
258 | + } | |
259 | + }, | |
260 | + "nbformat": 4, | |
261 | + "nbformat_minor": 5 | |
262 | +} |
+++ 20220418/.ipynb_checkpoints/pandas-checkpoint.ipynb
... | ... | @@ -0,0 +1,382 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 1, | |
6 | + "id": "135c4f51", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import pandas as pd" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 2, | |
16 | + "id": "e3deb7db", | |
17 | + "metadata": {}, | |
18 | + "outputs": [ | |
19 | + { | |
20 | + "data": { | |
21 | + "text/plain": [ | |
22 | + "'1.3.4'" | |
23 | + ] | |
24 | + }, | |
25 | + "execution_count": 2, | |
26 | + "metadata": {}, | |
27 | + "output_type": "execute_result" | |
28 | + } | |
29 | + ], | |
30 | + "source": [ | |
31 | + "pd.__version__" | |
32 | + ] | |
33 | + }, | |
34 | + { | |
35 | + "cell_type": "code", | |
36 | + "execution_count": 3, | |
37 | + "id": "622a5e4f", | |
38 | + "metadata": {}, | |
39 | + "outputs": [ | |
40 | + { | |
41 | + "data": { | |
42 | + "text/plain": [ | |
43 | + "[10, 20, 30, 40, 50]" | |
44 | + ] | |
45 | + }, | |
46 | + "execution_count": 3, | |
47 | + "metadata": {}, | |
48 | + "output_type": "execute_result" | |
49 | + } | |
50 | + ], | |
51 | + "source": [ | |
52 | + "data1 = [10, 20, 30, 40, 50]\n", | |
53 | + "data1" | |
54 | + ] | |
55 | + }, | |
56 | + { | |
57 | + "cell_type": "code", | |
58 | + "execution_count": 4, | |
59 | + "id": "c5c471cd", | |
60 | + "metadata": {}, | |
61 | + "outputs": [ | |
62 | + { | |
63 | + "data": { | |
64 | + "text/plain": [ | |
65 | + "['1반', '2반', '3반', '4반', '5반']" | |
66 | + ] | |
67 | + }, | |
68 | + "execution_count": 4, | |
69 | + "metadata": {}, | |
70 | + "output_type": "execute_result" | |
71 | + } | |
72 | + ], | |
73 | + "source": [ | |
74 | + "data2 = ['1반', '2반', '3반', '4반', '5반']\n", | |
75 | + "data2" | |
76 | + ] | |
77 | + }, | |
78 | + { | |
79 | + "cell_type": "code", | |
80 | + "execution_count": 6, | |
81 | + "id": "def4a017", | |
82 | + "metadata": {}, | |
83 | + "outputs": [ | |
84 | + { | |
85 | + "data": { | |
86 | + "text/plain": [ | |
87 | + "0 10\n", | |
88 | + "1 20\n", | |
89 | + "2 30\n", | |
90 | + "3 40\n", | |
91 | + "4 50\n", | |
92 | + "dtype: int64" | |
93 | + ] | |
94 | + }, | |
95 | + "execution_count": 6, | |
96 | + "metadata": {}, | |
97 | + "output_type": "execute_result" | |
98 | + } | |
99 | + ], | |
100 | + "source": [ | |
101 | + "sr1 = pd.Series(data1)\n", | |
102 | + "sr1" | |
103 | + ] | |
104 | + }, | |
105 | + { | |
106 | + "cell_type": "code", | |
107 | + "execution_count": 8, | |
108 | + "id": "e5eae9d2", | |
109 | + "metadata": {}, | |
110 | + "outputs": [ | |
111 | + { | |
112 | + "data": { | |
113 | + "text/plain": [ | |
114 | + "0 1반\n", | |
115 | + "1 2반\n", | |
116 | + "2 3반\n", | |
117 | + "3 4반\n", | |
118 | + "4 5반\n", | |
119 | + "dtype: object" | |
120 | + ] | |
121 | + }, | |
122 | + "execution_count": 8, | |
123 | + "metadata": {}, | |
124 | + "output_type": "execute_result" | |
125 | + } | |
126 | + ], | |
127 | + "source": [ | |
128 | + "sr2 = pd.Series(data2)\n", | |
129 | + "sr2" | |
130 | + ] | |
131 | + }, | |
132 | + { | |
133 | + "cell_type": "code", | |
134 | + "execution_count": 9, | |
135 | + "id": "b0a455a5", | |
136 | + "metadata": {}, | |
137 | + "outputs": [ | |
138 | + { | |
139 | + "data": { | |
140 | + "text/plain": [ | |
141 | + "0 101\n", | |
142 | + "1 102\n", | |
143 | + "2 103\n", | |
144 | + "3 104\n", | |
145 | + "4 105\n", | |
146 | + "dtype: int64" | |
147 | + ] | |
148 | + }, | |
149 | + "execution_count": 9, | |
150 | + "metadata": {}, | |
151 | + "output_type": "execute_result" | |
152 | + } | |
153 | + ], | |
154 | + "source": [ | |
155 | + "sr3 = pd.Series([101, 102, 103, 104, 105])\n", | |
156 | + "sr3" | |
157 | + ] | |
158 | + }, | |
159 | + { | |
160 | + "cell_type": "code", | |
161 | + "execution_count": 10, | |
162 | + "id": "dd083b80", | |
163 | + "metadata": {}, | |
164 | + "outputs": [ | |
165 | + { | |
166 | + "data": { | |
167 | + "text/plain": [ | |
168 | + "1000 10\n", | |
169 | + "1001 20\n", | |
170 | + "1002 30\n", | |
171 | + "1003 40\n", | |
172 | + "1004 50\n", | |
173 | + "dtype: int64" | |
174 | + ] | |
175 | + }, | |
176 | + "execution_count": 10, | |
177 | + "metadata": {}, | |
178 | + "output_type": "execute_result" | |
179 | + } | |
180 | + ], | |
181 | + "source": [ | |
182 | + "sr4 = pd.Series(data1, index=[1000, 1001, 1002, 1003, 1004])\n", | |
183 | + "sr4" | |
184 | + ] | |
185 | + }, | |
186 | + { | |
187 | + "cell_type": "code", | |
188 | + "execution_count": 11, | |
189 | + "id": "e8d864d7", | |
190 | + "metadata": {}, | |
191 | + "outputs": [ | |
192 | + { | |
193 | + "data": { | |
194 | + "text/plain": [ | |
195 | + "0 월\n", | |
196 | + "1 화\n", | |
197 | + "2 수\n", | |
198 | + "3 목\n", | |
199 | + "4 금\n", | |
200 | + "dtype: object" | |
201 | + ] | |
202 | + }, | |
203 | + "execution_count": 11, | |
204 | + "metadata": {}, | |
205 | + "output_type": "execute_result" | |
206 | + } | |
207 | + ], | |
208 | + "source": [ | |
209 | + "sr5 = pd.Series(['월', '화', '수', '목', '금'])\n", | |
210 | + "sr5" | |
211 | + ] | |
212 | + }, | |
213 | + { | |
214 | + "cell_type": "code", | |
215 | + "execution_count": 12, | |
216 | + "id": "cd3aead2", | |
217 | + "metadata": {}, | |
218 | + "outputs": [ | |
219 | + { | |
220 | + "data": { | |
221 | + "text/plain": [ | |
222 | + "1반 10\n", | |
223 | + "2반 20\n", | |
224 | + "3반 30\n", | |
225 | + "4반 40\n", | |
226 | + "5반 50\n", | |
227 | + "dtype: int64" | |
228 | + ] | |
229 | + }, | |
230 | + "execution_count": 12, | |
231 | + "metadata": {}, | |
232 | + "output_type": "execute_result" | |
233 | + } | |
234 | + ], | |
235 | + "source": [ | |
236 | + "sr6 = pd.Series(data1, index = data2)\n", | |
237 | + "sr6" | |
238 | + ] | |
239 | + }, | |
240 | + { | |
241 | + "cell_type": "code", | |
242 | + "execution_count": null, | |
243 | + "id": "2788f969", | |
244 | + "metadata": {}, | |
245 | + "outputs": [], | |
246 | + "source": [] | |
247 | + }, | |
248 | + { | |
249 | + "cell_type": "code", | |
250 | + "execution_count": null, | |
251 | + "id": "a34ac7f5", | |
252 | + "metadata": {}, | |
253 | + "outputs": [], | |
254 | + "source": [] | |
255 | + }, | |
256 | + { | |
257 | + "cell_type": "code", | |
258 | + "execution_count": null, | |
259 | + "id": "00e7827e", | |
260 | + "metadata": {}, | |
261 | + "outputs": [], | |
262 | + "source": [] | |
263 | + }, | |
264 | + { | |
265 | + "cell_type": "code", | |
266 | + "execution_count": null, | |
267 | + "id": "96f6d46f", | |
268 | + "metadata": {}, | |
269 | + "outputs": [], | |
270 | + "source": [] | |
271 | + }, | |
272 | + { | |
273 | + "cell_type": "code", | |
274 | + "execution_count": null, | |
275 | + "id": "522bccf9", | |
276 | + "metadata": {}, | |
277 | + "outputs": [], | |
278 | + "source": [] | |
279 | + }, | |
280 | + { | |
281 | + "cell_type": "code", | |
282 | + "execution_count": 14, | |
283 | + "id": "1f41dc16", | |
284 | + "metadata": {}, | |
285 | + "outputs": [ | |
286 | + { | |
287 | + "data": { | |
288 | + "text/plain": [ | |
289 | + "0 80\n", | |
290 | + "1 90\n", | |
291 | + "2 60\n", | |
292 | + "dtype: int64" | |
293 | + ] | |
294 | + }, | |
295 | + "execution_count": 14, | |
296 | + "metadata": {}, | |
297 | + "output_type": "execute_result" | |
298 | + } | |
299 | + ], | |
300 | + "source": [ | |
301 | + "pd.Series([80, 90, 60])" | |
302 | + ] | |
303 | + }, | |
304 | + { | |
305 | + "cell_type": "code", | |
306 | + "execution_count": 15, | |
307 | + "id": "c1fb87da", | |
308 | + "metadata": {}, | |
309 | + "outputs": [ | |
310 | + { | |
311 | + "data": { | |
312 | + "text/plain": [ | |
313 | + "국 80\n", | |
314 | + "영 90\n", | |
315 | + "수 60\n", | |
316 | + "dtype: int64" | |
317 | + ] | |
318 | + }, | |
319 | + "execution_count": 15, | |
320 | + "metadata": {}, | |
321 | + "output_type": "execute_result" | |
322 | + } | |
323 | + ], | |
324 | + "source": [ | |
325 | + "pd.Series([80, 90, 60], index=['국','영', '수'])" | |
326 | + ] | |
327 | + }, | |
328 | + { | |
329 | + "cell_type": "code", | |
330 | + "execution_count": null, | |
331 | + "id": "d57af4fa", | |
332 | + "metadata": {}, | |
333 | + "outputs": [], | |
334 | + "source": [] | |
335 | + }, | |
336 | + { | |
337 | + "cell_type": "code", | |
338 | + "execution_count": null, | |
339 | + "id": "1dbde3c0", | |
340 | + "metadata": {}, | |
341 | + "outputs": [], | |
342 | + "source": [] | |
343 | + }, | |
344 | + { | |
345 | + "cell_type": "code", | |
346 | + "execution_count": null, | |
347 | + "id": "873f52ff", | |
348 | + "metadata": {}, | |
349 | + "outputs": [], | |
350 | + "source": [] | |
351 | + }, | |
352 | + { | |
353 | + "cell_type": "code", | |
354 | + "execution_count": null, | |
355 | + "id": "3e7b5fa9", | |
356 | + "metadata": {}, | |
357 | + "outputs": [], | |
358 | + "source": [] | |
359 | + } | |
360 | + ], | |
361 | + "metadata": { | |
362 | + "kernelspec": { | |
363 | + "display_name": "Python 3 (ipykernel)", | |
364 | + "language": "python", | |
365 | + "name": "python3" | |
366 | + }, | |
367 | + "language_info": { | |
368 | + "codemirror_mode": { | |
369 | + "name": "ipython", | |
370 | + "version": 3 | |
371 | + }, | |
372 | + "file_extension": ".py", | |
373 | + "mimetype": "text/x-python", | |
374 | + "name": "python", | |
375 | + "nbconvert_exporter": "python", | |
376 | + "pygments_lexer": "ipython3", | |
377 | + "version": "3.9.7" | |
378 | + } | |
379 | + }, | |
380 | + "nbformat": 4, | |
381 | + "nbformat_minor": 5 | |
382 | +} |
+++ 20220418/DataFramee.ipynb
... | ... | @@ -0,0 +1,502 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 1, | |
6 | + "id": "2488d73e", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import pandas as pd" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 2, | |
16 | + "id": "5923b769", | |
17 | + "metadata": {}, | |
18 | + "outputs": [ | |
19 | + { | |
20 | + "data": { | |
21 | + "text/plain": [ | |
22 | + "{'year': [2018, 2019, 2020], 'sales': [350, 480, 1099]}" | |
23 | + ] | |
24 | + }, | |
25 | + "execution_count": 2, | |
26 | + "metadata": {}, | |
27 | + "output_type": "execute_result" | |
28 | + } | |
29 | + ], | |
30 | + "source": [ | |
31 | + "data_dic = {\n", | |
32 | + " 'year' : [2018, 2019, 2020],\n", | |
33 | + " 'sales' : [350, 480, 1099]\n", | |
34 | + "}\n", | |
35 | + "data_dic" | |
36 | + ] | |
37 | + }, | |
38 | + { | |
39 | + "cell_type": "code", | |
40 | + "execution_count": 4, | |
41 | + "id": "1919e60b", | |
42 | + "metadata": {}, | |
43 | + "outputs": [ | |
44 | + { | |
45 | + "data": { | |
46 | + "text/plain": [ | |
47 | + "year [2018, 2019, 2020]\n", | |
48 | + "sales [350, 480, 1099]\n", | |
49 | + "dtype: object" | |
50 | + ] | |
51 | + }, | |
52 | + "execution_count": 4, | |
53 | + "metadata": {}, | |
54 | + "output_type": "execute_result" | |
55 | + } | |
56 | + ], | |
57 | + "source": [ | |
58 | + "ds = pd.Series(data_dic)\n", | |
59 | + "ds" | |
60 | + ] | |
61 | + }, | |
62 | + { | |
63 | + "cell_type": "code", | |
64 | + "execution_count": 6, | |
65 | + "id": "dd46a777", | |
66 | + "metadata": {}, | |
67 | + "outputs": [ | |
68 | + { | |
69 | + "data": { | |
70 | + "text/html": [ | |
71 | + "<div>\n", | |
72 | + "<style scoped>\n", | |
73 | + " .dataframe tbody tr th:only-of-type {\n", | |
74 | + " vertical-align: middle;\n", | |
75 | + " }\n", | |
76 | + "\n", | |
77 | + " .dataframe tbody tr th {\n", | |
78 | + " vertical-align: top;\n", | |
79 | + " }\n", | |
80 | + "\n", | |
81 | + " .dataframe thead th {\n", | |
82 | + " text-align: right;\n", | |
83 | + " }\n", | |
84 | + "</style>\n", | |
85 | + "<table border=\"1\" class=\"dataframe\">\n", | |
86 | + " <thead>\n", | |
87 | + " <tr style=\"text-align: right;\">\n", | |
88 | + " <th></th>\n", | |
89 | + " <th>year</th>\n", | |
90 | + " <th>sales</th>\n", | |
91 | + " </tr>\n", | |
92 | + " </thead>\n", | |
93 | + " <tbody>\n", | |
94 | + " <tr>\n", | |
95 | + " <th>0</th>\n", | |
96 | + " <td>2018</td>\n", | |
97 | + " <td>350</td>\n", | |
98 | + " </tr>\n", | |
99 | + " <tr>\n", | |
100 | + " <th>1</th>\n", | |
101 | + " <td>2019</td>\n", | |
102 | + " <td>480</td>\n", | |
103 | + " </tr>\n", | |
104 | + " <tr>\n", | |
105 | + " <th>2</th>\n", | |
106 | + " <td>2020</td>\n", | |
107 | + " <td>1099</td>\n", | |
108 | + " </tr>\n", | |
109 | + " </tbody>\n", | |
110 | + "</table>\n", | |
111 | + "</div>" | |
112 | + ], | |
113 | + "text/plain": [ | |
114 | + " year sales\n", | |
115 | + "0 2018 350\n", | |
116 | + "1 2019 480\n", | |
117 | + "2 2020 1099" | |
118 | + ] | |
119 | + }, | |
120 | + "execution_count": 6, | |
121 | + "metadata": {}, | |
122 | + "output_type": "execute_result" | |
123 | + } | |
124 | + ], | |
125 | + "source": [ | |
126 | + "df1 = pd.DataFrame(data_dic)\n", | |
127 | + "df1" | |
128 | + ] | |
129 | + }, | |
130 | + { | |
131 | + "cell_type": "code", | |
132 | + "execution_count": 7, | |
133 | + "id": "14e8c8e5", | |
134 | + "metadata": {}, | |
135 | + "outputs": [ | |
136 | + { | |
137 | + "data": { | |
138 | + "text/html": [ | |
139 | + "<div>\n", | |
140 | + "<style scoped>\n", | |
141 | + " .dataframe tbody tr th:only-of-type {\n", | |
142 | + " vertical-align: middle;\n", | |
143 | + " }\n", | |
144 | + "\n", | |
145 | + " .dataframe tbody tr th {\n", | |
146 | + " vertical-align: top;\n", | |
147 | + " }\n", | |
148 | + "\n", | |
149 | + " .dataframe thead th {\n", | |
150 | + " text-align: right;\n", | |
151 | + " }\n", | |
152 | + "</style>\n", | |
153 | + "<table border=\"1\" class=\"dataframe\">\n", | |
154 | + " <thead>\n", | |
155 | + " <tr style=\"text-align: right;\">\n", | |
156 | + " <th></th>\n", | |
157 | + " <th>sales</th>\n", | |
158 | + " </tr>\n", | |
159 | + " <tr>\n", | |
160 | + " <th>year</th>\n", | |
161 | + " <th></th>\n", | |
162 | + " </tr>\n", | |
163 | + " </thead>\n", | |
164 | + " <tbody>\n", | |
165 | + " <tr>\n", | |
166 | + " <th>2018</th>\n", | |
167 | + " <td>350</td>\n", | |
168 | + " </tr>\n", | |
169 | + " <tr>\n", | |
170 | + " <th>2019</th>\n", | |
171 | + " <td>480</td>\n", | |
172 | + " </tr>\n", | |
173 | + " <tr>\n", | |
174 | + " <th>2020</th>\n", | |
175 | + " <td>1099</td>\n", | |
176 | + " </tr>\n", | |
177 | + " </tbody>\n", | |
178 | + "</table>\n", | |
179 | + "</div>" | |
180 | + ], | |
181 | + "text/plain": [ | |
182 | + " sales\n", | |
183 | + "year \n", | |
184 | + "2018 350\n", | |
185 | + "2019 480\n", | |
186 | + "2020 1099" | |
187 | + ] | |
188 | + }, | |
189 | + "execution_count": 7, | |
190 | + "metadata": {}, | |
191 | + "output_type": "execute_result" | |
192 | + } | |
193 | + ], | |
194 | + "source": [ | |
195 | + "df1.set_index('year')" | |
196 | + ] | |
197 | + }, | |
198 | + { | |
199 | + "cell_type": "code", | |
200 | + "execution_count": 10, | |
201 | + "id": "6f0a64c7", | |
202 | + "metadata": {}, | |
203 | + "outputs": [ | |
204 | + { | |
205 | + "data": { | |
206 | + "text/html": [ | |
207 | + "<div>\n", | |
208 | + "<style scoped>\n", | |
209 | + " .dataframe tbody tr th:only-of-type {\n", | |
210 | + " vertical-align: middle;\n", | |
211 | + " }\n", | |
212 | + "\n", | |
213 | + " .dataframe tbody tr th {\n", | |
214 | + " vertical-align: top;\n", | |
215 | + " }\n", | |
216 | + "\n", | |
217 | + " .dataframe thead th {\n", | |
218 | + " text-align: right;\n", | |
219 | + " }\n", | |
220 | + "</style>\n", | |
221 | + "<table border=\"1\" class=\"dataframe\">\n", | |
222 | + " <thead>\n", | |
223 | + " <tr style=\"text-align: right;\">\n", | |
224 | + " <th></th>\n", | |
225 | + " <th>1반</th>\n", | |
226 | + " <th>2반</th>\n", | |
227 | + " <th>3반</th>\n", | |
228 | + " </tr>\n", | |
229 | + " </thead>\n", | |
230 | + " <tbody>\n", | |
231 | + " <tr>\n", | |
232 | + " <th>중간고사</th>\n", | |
233 | + " <td>89.2</td>\n", | |
234 | + " <td>92.5</td>\n", | |
235 | + " <td>90.8</td>\n", | |
236 | + " </tr>\n", | |
237 | + " <tr>\n", | |
238 | + " <th>기말고사</th>\n", | |
239 | + " <td>92.8</td>\n", | |
240 | + " <td>89.9</td>\n", | |
241 | + " <td>95.2</td>\n", | |
242 | + " </tr>\n", | |
243 | + " </tbody>\n", | |
244 | + "</table>\n", | |
245 | + "</div>" | |
246 | + ], | |
247 | + "text/plain": [ | |
248 | + " 1반 2반 3반\n", | |
249 | + "중간고사 89.2 92.5 90.8\n", | |
250 | + "기말고사 92.8 89.9 95.2" | |
251 | + ] | |
252 | + }, | |
253 | + "execution_count": 10, | |
254 | + "metadata": {}, | |
255 | + "output_type": "execute_result" | |
256 | + } | |
257 | + ], | |
258 | + "source": [ | |
259 | + "data2 = ['1반', '2반', '3반']\n", | |
260 | + "df2 = pd.DataFrame([[89.2, 92.5, 90.8], [92.8, 89.9, 95.2]], index = ['중간고사', '기말고사'], columns = data2[0:3])\n", | |
261 | + "df2" | |
262 | + ] | |
263 | + }, | |
264 | + { | |
265 | + "cell_type": "code", | |
266 | + "execution_count": 11, | |
267 | + "id": "a1ea90d8", | |
268 | + "metadata": {}, | |
269 | + "outputs": [], | |
270 | + "source": [ | |
271 | + "df1 = pd.DataFrame([[89.2, 92.5, 90.8], [92.8, 89.9, 95.2]])" | |
272 | + ] | |
273 | + }, | |
274 | + { | |
275 | + "cell_type": "code", | |
276 | + "execution_count": 12, | |
277 | + "id": "db0b10ea", | |
278 | + "metadata": {}, | |
279 | + "outputs": [ | |
280 | + { | |
281 | + "data": { | |
282 | + "text/html": [ | |
283 | + "<div>\n", | |
284 | + "<style scoped>\n", | |
285 | + " .dataframe tbody tr th:only-of-type {\n", | |
286 | + " vertical-align: middle;\n", | |
287 | + " }\n", | |
288 | + "\n", | |
289 | + " .dataframe tbody tr th {\n", | |
290 | + " vertical-align: top;\n", | |
291 | + " }\n", | |
292 | + "\n", | |
293 | + " .dataframe thead th {\n", | |
294 | + " text-align: right;\n", | |
295 | + " }\n", | |
296 | + "</style>\n", | |
297 | + "<table border=\"1\" class=\"dataframe\">\n", | |
298 | + " <thead>\n", | |
299 | + " <tr style=\"text-align: right;\">\n", | |
300 | + " <th></th>\n", | |
301 | + " <th>0</th>\n", | |
302 | + " <th>1</th>\n", | |
303 | + " <th>2</th>\n", | |
304 | + " </tr>\n", | |
305 | + " </thead>\n", | |
306 | + " <tbody>\n", | |
307 | + " <tr>\n", | |
308 | + " <th>0</th>\n", | |
309 | + " <td>89.2</td>\n", | |
310 | + " <td>92.5</td>\n", | |
311 | + " <td>90.8</td>\n", | |
312 | + " </tr>\n", | |
313 | + " <tr>\n", | |
314 | + " <th>1</th>\n", | |
315 | + " <td>92.8</td>\n", | |
316 | + " <td>89.9</td>\n", | |
317 | + " <td>95.2</td>\n", | |
318 | + " </tr>\n", | |
319 | + " </tbody>\n", | |
320 | + "</table>\n", | |
321 | + "</div>" | |
322 | + ], | |
323 | + "text/plain": [ | |
324 | + " 0 1 2\n", | |
325 | + "0 89.2 92.5 90.8\n", | |
326 | + "1 92.8 89.9 95.2" | |
327 | + ] | |
328 | + }, | |
329 | + "execution_count": 12, | |
330 | + "metadata": {}, | |
331 | + "output_type": "execute_result" | |
332 | + } | |
333 | + ], | |
334 | + "source": [ | |
335 | + "df1" | |
336 | + ] | |
337 | + }, | |
338 | + { | |
339 | + "cell_type": "code", | |
340 | + "execution_count": 13, | |
341 | + "id": "0deb3702", | |
342 | + "metadata": {}, | |
343 | + "outputs": [], | |
344 | + "source": [ | |
345 | + "df1.columns = {1, 2, 3}" | |
346 | + ] | |
347 | + }, | |
348 | + { | |
349 | + "cell_type": "code", | |
350 | + "execution_count": 15, | |
351 | + "id": "069b808e", | |
352 | + "metadata": {}, | |
353 | + "outputs": [], | |
354 | + "source": [ | |
355 | + "df1.index = {'middle', 'final'}" | |
356 | + ] | |
357 | + }, | |
358 | + { | |
359 | + "cell_type": "code", | |
360 | + "execution_count": 16, | |
361 | + "id": "9ee94d2c", | |
362 | + "metadata": {}, | |
363 | + "outputs": [ | |
364 | + { | |
365 | + "data": { | |
366 | + "text/html": [ | |
367 | + "<div>\n", | |
368 | + "<style scoped>\n", | |
369 | + " .dataframe tbody tr th:only-of-type {\n", | |
370 | + " vertical-align: middle;\n", | |
371 | + " }\n", | |
372 | + "\n", | |
373 | + " .dataframe tbody tr th {\n", | |
374 | + " vertical-align: top;\n", | |
375 | + " }\n", | |
376 | + "\n", | |
377 | + " .dataframe thead th {\n", | |
378 | + " text-align: right;\n", | |
379 | + " }\n", | |
380 | + "</style>\n", | |
381 | + "<table border=\"1\" class=\"dataframe\">\n", | |
382 | + " <thead>\n", | |
383 | + " <tr style=\"text-align: right;\">\n", | |
384 | + " <th></th>\n", | |
385 | + " <th>1</th>\n", | |
386 | + " <th>2</th>\n", | |
387 | + " <th>3</th>\n", | |
388 | + " </tr>\n", | |
389 | + " </thead>\n", | |
390 | + " <tbody>\n", | |
391 | + " <tr>\n", | |
392 | + " <th>middle</th>\n", | |
393 | + " <td>89.2</td>\n", | |
394 | + " <td>92.5</td>\n", | |
395 | + " <td>90.8</td>\n", | |
396 | + " </tr>\n", | |
397 | + " <tr>\n", | |
398 | + " <th>final</th>\n", | |
399 | + " <td>92.8</td>\n", | |
400 | + " <td>89.9</td>\n", | |
401 | + " <td>95.2</td>\n", | |
402 | + " </tr>\n", | |
403 | + " </tbody>\n", | |
404 | + "</table>\n", | |
405 | + "</div>" | |
406 | + ], | |
407 | + "text/plain": [ | |
408 | + " 1 2 3\n", | |
409 | + "middle 89.2 92.5 90.8\n", | |
410 | + "final 92.8 89.9 95.2" | |
411 | + ] | |
412 | + }, | |
413 | + "execution_count": 16, | |
414 | + "metadata": {}, | |
415 | + "output_type": "execute_result" | |
416 | + } | |
417 | + ], | |
418 | + "source": [ | |
419 | + "df1" | |
420 | + ] | |
421 | + }, | |
422 | + { | |
423 | + "cell_type": "code", | |
424 | + "execution_count": 20, | |
425 | + "id": "8cdb7b5f", | |
426 | + "metadata": {}, | |
427 | + "outputs": [], | |
428 | + "source": [ | |
429 | + "df1.to_csv('C:/Users/pc/dev/20220418/score.csv')" | |
430 | + ] | |
431 | + }, | |
432 | + { | |
433 | + "cell_type": "code", | |
434 | + "execution_count": 21, | |
435 | + "id": "d7b41ef1", | |
436 | + "metadata": {}, | |
437 | + "outputs": [], | |
438 | + "source": [ | |
439 | + "df1.to_csv('C:/Users/pc/dev/20220418/score2.csv', header='False')" | |
440 | + ] | |
441 | + }, | |
442 | + { | |
443 | + "cell_type": "code", | |
444 | + "execution_count": 22, | |
445 | + "id": "971fd233", | |
446 | + "metadata": {}, | |
447 | + "outputs": [], | |
448 | + "source": [ | |
449 | + "df1.to_csv('C:/Users/pc/dev/20220418/score3.csv', encoding='utf-8')" | |
450 | + ] | |
451 | + }, | |
452 | + { | |
453 | + "cell_type": "code", | |
454 | + "execution_count": 23, | |
455 | + "id": "a3539477", | |
456 | + "metadata": {}, | |
457 | + "outputs": [], | |
458 | + "source": [ | |
459 | + "df1.to_csv('C:/Users/pc/dev/20220418/score4.csv', encoding='euc-kr')" | |
460 | + ] | |
461 | + }, | |
462 | + { | |
463 | + "cell_type": "code", | |
464 | + "execution_count": 24, | |
465 | + "id": "66613fcc", | |
466 | + "metadata": {}, | |
467 | + "outputs": [], | |
468 | + "source": [ | |
469 | + "df1.to_csv('C:/Users/pc/dev/20220418/score5.csv', encoding='ms949')" | |
470 | + ] | |
471 | + }, | |
472 | + { | |
473 | + "cell_type": "code", | |
474 | + "execution_count": null, | |
475 | + "id": "6c64e3d3", | |
476 | + "metadata": {}, | |
477 | + "outputs": [], | |
478 | + "source": [] | |
479 | + } | |
480 | + ], | |
481 | + "metadata": { | |
482 | + "kernelspec": { | |
483 | + "display_name": "Python 3 (ipykernel)", | |
484 | + "language": "python", | |
485 | + "name": "python3" | |
486 | + }, | |
487 | + "language_info": { | |
488 | + "codemirror_mode": { | |
489 | + "name": "ipython", | |
490 | + "version": 3 | |
491 | + }, | |
492 | + "file_extension": ".py", | |
493 | + "mimetype": "text/x-python", | |
494 | + "name": "python", | |
495 | + "nbconvert_exporter": "python", | |
496 | + "pygments_lexer": "ipython3", | |
497 | + "version": "3.9.7" | |
498 | + } | |
499 | + }, | |
500 | + "nbformat": 4, | |
501 | + "nbformat_minor": 5 | |
502 | +} |
+++ 20220418/Matplotlib.ipynb
... | ... | @@ -0,0 +1,112 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 1, | |
6 | + "id": "62351d3c", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import matplotlib" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 2, | |
16 | + "id": "48e7bcba", | |
17 | + "metadata": {}, | |
18 | + "outputs": [ | |
19 | + { | |
20 | + "data": { | |
21 | + "text/plain": [ | |
22 | + "'3.4.3'" | |
23 | + ] | |
24 | + }, | |
25 | + "execution_count": 2, | |
26 | + "metadata": {}, | |
27 | + "output_type": "execute_result" | |
28 | + } | |
29 | + ], | |
30 | + "source": [ | |
31 | + "matplotlib.__version__" | |
32 | + ] | |
33 | + }, | |
34 | + { | |
35 | + "cell_type": "code", | |
36 | + "execution_count": 3, | |
37 | + "id": "c0c70010", | |
38 | + "metadata": {}, | |
39 | + "outputs": [], | |
40 | + "source": [ | |
41 | + "import matplotlib.pyplot as plt" | |
42 | + ] | |
43 | + }, | |
44 | + { | |
45 | + "cell_type": "code", | |
46 | + "execution_count": 4, | |
47 | + "id": "1469fa89", | |
48 | + "metadata": {}, | |
49 | + "outputs": [], | |
50 | + "source": [ | |
51 | + "x = [2016, 2017, 2018, 2019, 2020]\n", | |
52 | + "y = [350, 410, 520, 695, 543]" | |
53 | + ] | |
54 | + }, | |
55 | + { | |
56 | + "cell_type": "code", | |
57 | + "execution_count": 10, | |
58 | + "id": "6a2e6507", | |
59 | + "metadata": {}, | |
60 | + "outputs": [ | |
61 | + { | |
62 | + "data": { | |
63 | + "image/png": "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\n", | |
64 | + "text/plain": [ | |
65 | + "<Figure size 432x288 with 1 Axes>" | |
66 | + ] | |
67 | + }, | |
68 | + "metadata": { | |
69 | + "needs_background": "light" | |
70 | + }, | |
71 | + "output_type": "display_data" | |
72 | + } | |
73 | + ], | |
74 | + "source": [ | |
75 | + "plt.plot(x, y)\n", | |
76 | + "plt.title('Annual sales')\n", | |
77 | + "plt.xlabel('years')\n", | |
78 | + "plt.ylabel('sales')\n", | |
79 | + "plt.show()" | |
80 | + ] | |
81 | + }, | |
82 | + { | |
83 | + "cell_type": "code", | |
84 | + "execution_count": null, | |
85 | + "id": "a412e599", | |
86 | + "metadata": {}, | |
87 | + "outputs": [], | |
88 | + "source": [] | |
89 | + } | |
90 | + ], | |
91 | + "metadata": { | |
92 | + "kernelspec": { | |
93 | + "display_name": "Python 3 (ipykernel)", | |
94 | + "language": "python", | |
95 | + "name": "python3" | |
96 | + }, | |
97 | + "language_info": { | |
98 | + "codemirror_mode": { | |
99 | + "name": "ipython", | |
100 | + "version": 3 | |
101 | + }, | |
102 | + "file_extension": ".py", | |
103 | + "mimetype": "text/x-python", | |
104 | + "name": "python", | |
105 | + "nbconvert_exporter": "python", | |
106 | + "pygments_lexer": "ipython3", | |
107 | + "version": "3.9.7" | |
108 | + } | |
109 | + }, | |
110 | + "nbformat": 4, | |
111 | + "nbformat_minor": 5 | |
112 | +} |
+++ 20220418/numpy.ipynb
... | ... | @@ -0,0 +1,262 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 5, | |
6 | + "id": "4a18b98a", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import numpy as np" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 11, | |
16 | + "id": "0c3e1e30", | |
17 | + "metadata": {}, | |
18 | + "outputs": [ | |
19 | + { | |
20 | + "data": { | |
21 | + "text/plain": [ | |
22 | + "'1.20.3'" | |
23 | + ] | |
24 | + }, | |
25 | + "execution_count": 11, | |
26 | + "metadata": {}, | |
27 | + "output_type": "execute_result" | |
28 | + } | |
29 | + ], | |
30 | + "source": [ | |
31 | + "np.__version__" | |
32 | + ] | |
33 | + }, | |
34 | + { | |
35 | + "cell_type": "code", | |
36 | + "execution_count": 24, | |
37 | + "id": "e3b36b1f", | |
38 | + "metadata": {}, | |
39 | + "outputs": [ | |
40 | + { | |
41 | + "data": { | |
42 | + "text/plain": [ | |
43 | + "numpy.ndarray" | |
44 | + ] | |
45 | + }, | |
46 | + "execution_count": 24, | |
47 | + "metadata": {}, | |
48 | + "output_type": "execute_result" | |
49 | + } | |
50 | + ], | |
51 | + "source": [ | |
52 | + "ar1 = np.array([1, 2, 3, 4, 5])\n", | |
53 | + "type(ar1)" | |
54 | + ] | |
55 | + }, | |
56 | + { | |
57 | + "cell_type": "code", | |
58 | + "execution_count": 28, | |
59 | + "id": "d3fd2749", | |
60 | + "metadata": {}, | |
61 | + "outputs": [ | |
62 | + { | |
63 | + "data": { | |
64 | + "text/plain": [ | |
65 | + "list" | |
66 | + ] | |
67 | + }, | |
68 | + "execution_count": 28, | |
69 | + "metadata": {}, | |
70 | + "output_type": "execute_result" | |
71 | + } | |
72 | + ], | |
73 | + "source": [ | |
74 | + "list1 = [[10, 20 ,30], [40, 50, 60]]\n", | |
75 | + "type(list1)" | |
76 | + ] | |
77 | + }, | |
78 | + { | |
79 | + "cell_type": "code", | |
80 | + "execution_count": 29, | |
81 | + "id": "f6817fb2", | |
82 | + "metadata": {}, | |
83 | + "outputs": [ | |
84 | + { | |
85 | + "data": { | |
86 | + "text/plain": [ | |
87 | + "array([[10, 20, 30],\n", | |
88 | + " [40, 50, 60]])" | |
89 | + ] | |
90 | + }, | |
91 | + "execution_count": 29, | |
92 | + "metadata": {}, | |
93 | + "output_type": "execute_result" | |
94 | + } | |
95 | + ], | |
96 | + "source": [ | |
97 | + "ar2 = np.array(list1)\n", | |
98 | + "ar2" | |
99 | + ] | |
100 | + }, | |
101 | + { | |
102 | + "cell_type": "code", | |
103 | + "execution_count": 30, | |
104 | + "id": "734954ee", | |
105 | + "metadata": {}, | |
106 | + "outputs": [ | |
107 | + { | |
108 | + "data": { | |
109 | + "text/plain": [ | |
110 | + "array([1, 3, 5, 7, 9])" | |
111 | + ] | |
112 | + }, | |
113 | + "execution_count": 30, | |
114 | + "metadata": {}, | |
115 | + "output_type": "execute_result" | |
116 | + } | |
117 | + ], | |
118 | + "source": [ | |
119 | + "ar3 = np.arange(1, 11, 2)\n", | |
120 | + "ar3" | |
121 | + ] | |
122 | + }, | |
123 | + { | |
124 | + "cell_type": "code", | |
125 | + "execution_count": 43, | |
126 | + "id": "9288e528", | |
127 | + "metadata": {}, | |
128 | + "outputs": [ | |
129 | + { | |
130 | + "data": { | |
131 | + "text/plain": [ | |
132 | + "array([ 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26,\n", | |
133 | + " 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52,\n", | |
134 | + " 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78,\n", | |
135 | + " 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100])" | |
136 | + ] | |
137 | + }, | |
138 | + "execution_count": 43, | |
139 | + "metadata": {}, | |
140 | + "output_type": "execute_result" | |
141 | + } | |
142 | + ], | |
143 | + "source": [ | |
144 | + "ar3_1 = np.arange(2, 101, 2)\n", | |
145 | + "ar3_1" | |
146 | + ] | |
147 | + }, | |
148 | + { | |
149 | + "cell_type": "code", | |
150 | + "execution_count": 45, | |
151 | + "id": "55f5ed5e", | |
152 | + "metadata": {}, | |
153 | + "outputs": [ | |
154 | + { | |
155 | + "data": { | |
156 | + "text/plain": [ | |
157 | + "array([[1, 2],\n", | |
158 | + " [3, 4],\n", | |
159 | + " [5, 6]])" | |
160 | + ] | |
161 | + }, | |
162 | + "execution_count": 45, | |
163 | + "metadata": {}, | |
164 | + "output_type": "execute_result" | |
165 | + } | |
166 | + ], | |
167 | + "source": [ | |
168 | + "ar4 = np.array([1, 2, 3, 4, 5, 6]).reshape((3, 2))\n", | |
169 | + "ar4" | |
170 | + ] | |
171 | + }, | |
172 | + { | |
173 | + "cell_type": "code", | |
174 | + "execution_count": 32, | |
175 | + "id": "e2888e7c", | |
176 | + "metadata": {}, | |
177 | + "outputs": [ | |
178 | + { | |
179 | + "data": { | |
180 | + "text/plain": [ | |
181 | + "array([[0., 0., 0.],\n", | |
182 | + " [0., 0., 0.]])" | |
183 | + ] | |
184 | + }, | |
185 | + "execution_count": 32, | |
186 | + "metadata": {}, | |
187 | + "output_type": "execute_result" | |
188 | + } | |
189 | + ], | |
190 | + "source": [ | |
191 | + "ar5 = np.zeros((2, 3))\n", | |
192 | + "ar5" | |
193 | + ] | |
194 | + }, | |
195 | + { | |
196 | + "cell_type": "code", | |
197 | + "execution_count": 46, | |
198 | + "id": "833867ef", | |
199 | + "metadata": {}, | |
200 | + "outputs": [ | |
201 | + { | |
202 | + "data": { | |
203 | + "text/plain": [ | |
204 | + "array([[10, 20],\n", | |
205 | + " [40, 50]])" | |
206 | + ] | |
207 | + }, | |
208 | + "execution_count": 46, | |
209 | + "metadata": {}, | |
210 | + "output_type": "execute_result" | |
211 | + } | |
212 | + ], | |
213 | + "source": [ | |
214 | + "ar6 = ar2[0:2, 0:2]\n", | |
215 | + "ar6" | |
216 | + ] | |
217 | + }, | |
218 | + { | |
219 | + "cell_type": "code", | |
220 | + "execution_count": 47, | |
221 | + "id": "3e9d7308", | |
222 | + "metadata": {}, | |
223 | + "outputs": [ | |
224 | + { | |
225 | + "data": { | |
226 | + "text/plain": [ | |
227 | + "array([10, 20, 30])" | |
228 | + ] | |
229 | + }, | |
230 | + "execution_count": 47, | |
231 | + "metadata": {}, | |
232 | + "output_type": "execute_result" | |
233 | + } | |
234 | + ], | |
235 | + "source": [ | |
236 | + "ar7 = ar2[0, :]\n", | |
237 | + "ar7" | |
238 | + ] | |
239 | + } | |
240 | + ], | |
241 | + "metadata": { | |
242 | + "kernelspec": { | |
243 | + "display_name": "Python 3 (ipykernel)", | |
244 | + "language": "python", | |
245 | + "name": "python3" | |
246 | + }, | |
247 | + "language_info": { | |
248 | + "codemirror_mode": { | |
249 | + "name": "ipython", | |
250 | + "version": 3 | |
251 | + }, | |
252 | + "file_extension": ".py", | |
253 | + "mimetype": "text/x-python", | |
254 | + "name": "python", | |
255 | + "nbconvert_exporter": "python", | |
256 | + "pygments_lexer": "ipython3", | |
257 | + "version": "3.9.7" | |
258 | + } | |
259 | + }, | |
260 | + "nbformat": 4, | |
261 | + "nbformat_minor": 5 | |
262 | +} |
+++ 20220418/pandas.ipynb
... | ... | @@ -0,0 +1,382 @@ |
1 | +{ | |
2 | + "cells": [ | |
3 | + { | |
4 | + "cell_type": "code", | |
5 | + "execution_count": 1, | |
6 | + "id": "135c4f51", | |
7 | + "metadata": {}, | |
8 | + "outputs": [], | |
9 | + "source": [ | |
10 | + "import pandas as pd" | |
11 | + ] | |
12 | + }, | |
13 | + { | |
14 | + "cell_type": "code", | |
15 | + "execution_count": 2, | |
16 | + "id": "e3deb7db", | |
17 | + "metadata": {}, | |
18 | + "outputs": [ | |
19 | + { | |
20 | + "data": { | |
21 | + "text/plain": [ | |
22 | + "'1.3.4'" | |
23 | + ] | |
24 | + }, | |
25 | + "execution_count": 2, | |
26 | + "metadata": {}, | |
27 | + "output_type": "execute_result" | |
28 | + } | |
29 | + ], | |
30 | + "source": [ | |
31 | + "pd.__version__" | |
32 | + ] | |
33 | + }, | |
34 | + { | |
35 | + "cell_type": "code", | |
36 | + "execution_count": 3, | |
37 | + "id": "622a5e4f", | |
38 | + "metadata": {}, | |
39 | + "outputs": [ | |
40 | + { | |
41 | + "data": { | |
42 | + "text/plain": [ | |
43 | + "[10, 20, 30, 40, 50]" | |
44 | + ] | |
45 | + }, | |
46 | + "execution_count": 3, | |
47 | + "metadata": {}, | |
48 | + "output_type": "execute_result" | |
49 | + } | |
50 | + ], | |
51 | + "source": [ | |
52 | + "data1 = [10, 20, 30, 40, 50]\n", | |
53 | + "data1" | |
54 | + ] | |
55 | + }, | |
56 | + { | |
57 | + "cell_type": "code", | |
58 | + "execution_count": 4, | |
59 | + "id": "c5c471cd", | |
60 | + "metadata": {}, | |
61 | + "outputs": [ | |
62 | + { | |
63 | + "data": { | |
64 | + "text/plain": [ | |
65 | + "['1반', '2반', '3반', '4반', '5반']" | |
66 | + ] | |
67 | + }, | |
68 | + "execution_count": 4, | |
69 | + "metadata": {}, | |
70 | + "output_type": "execute_result" | |
71 | + } | |
72 | + ], | |
73 | + "source": [ | |
74 | + "data2 = ['1반', '2반', '3반', '4반', '5반']\n", | |
75 | + "data2" | |
76 | + ] | |
77 | + }, | |
78 | + { | |
79 | + "cell_type": "code", | |
80 | + "execution_count": 6, | |
81 | + "id": "def4a017", | |
82 | + "metadata": {}, | |
83 | + "outputs": [ | |
84 | + { | |
85 | + "data": { | |
86 | + "text/plain": [ | |
87 | + "0 10\n", | |
88 | + "1 20\n", | |
89 | + "2 30\n", | |
90 | + "3 40\n", | |
91 | + "4 50\n", | |
92 | + "dtype: int64" | |
93 | + ] | |
94 | + }, | |
95 | + "execution_count": 6, | |
96 | + "metadata": {}, | |
97 | + "output_type": "execute_result" | |
98 | + } | |
99 | + ], | |
100 | + "source": [ | |
101 | + "sr1 = pd.Series(data1)\n", | |
102 | + "sr1" | |
103 | + ] | |
104 | + }, | |
105 | + { | |
106 | + "cell_type": "code", | |
107 | + "execution_count": 8, | |
108 | + "id": "e5eae9d2", | |
109 | + "metadata": {}, | |
110 | + "outputs": [ | |
111 | + { | |
112 | + "data": { | |
113 | + "text/plain": [ | |
114 | + "0 1반\n", | |
115 | + "1 2반\n", | |
116 | + "2 3반\n", | |
117 | + "3 4반\n", | |
118 | + "4 5반\n", | |
119 | + "dtype: object" | |
120 | + ] | |
121 | + }, | |
122 | + "execution_count": 8, | |
123 | + "metadata": {}, | |
124 | + "output_type": "execute_result" | |
125 | + } | |
126 | + ], | |
127 | + "source": [ | |
128 | + "sr2 = pd.Series(data2)\n", | |
129 | + "sr2" | |
130 | + ] | |
131 | + }, | |
132 | + { | |
133 | + "cell_type": "code", | |
134 | + "execution_count": 9, | |
135 | + "id": "b0a455a5", | |
136 | + "metadata": {}, | |
137 | + "outputs": [ | |
138 | + { | |
139 | + "data": { | |
140 | + "text/plain": [ | |
141 | + "0 101\n", | |
142 | + "1 102\n", | |
143 | + "2 103\n", | |
144 | + "3 104\n", | |
145 | + "4 105\n", | |
146 | + "dtype: int64" | |
147 | + ] | |
148 | + }, | |
149 | + "execution_count": 9, | |
150 | + "metadata": {}, | |
151 | + "output_type": "execute_result" | |
152 | + } | |
153 | + ], | |
154 | + "source": [ | |
155 | + "sr3 = pd.Series([101, 102, 103, 104, 105])\n", | |
156 | + "sr3" | |
157 | + ] | |
158 | + }, | |
159 | + { | |
160 | + "cell_type": "code", | |
161 | + "execution_count": 10, | |
162 | + "id": "dd083b80", | |
163 | + "metadata": {}, | |
164 | + "outputs": [ | |
165 | + { | |
166 | + "data": { | |
167 | + "text/plain": [ | |
168 | + "1000 10\n", | |
169 | + "1001 20\n", | |
170 | + "1002 30\n", | |
171 | + "1003 40\n", | |
172 | + "1004 50\n", | |
173 | + "dtype: int64" | |
174 | + ] | |
175 | + }, | |
176 | + "execution_count": 10, | |
177 | + "metadata": {}, | |
178 | + "output_type": "execute_result" | |
179 | + } | |
180 | + ], | |
181 | + "source": [ | |
182 | + "sr4 = pd.Series(data1, index=[1000, 1001, 1002, 1003, 1004])\n", | |
183 | + "sr4" | |
184 | + ] | |
185 | + }, | |
186 | + { | |
187 | + "cell_type": "code", | |
188 | + "execution_count": 11, | |
189 | + "id": "e8d864d7", | |
190 | + "metadata": {}, | |
191 | + "outputs": [ | |
192 | + { | |
193 | + "data": { | |
194 | + "text/plain": [ | |
195 | + "0 월\n", | |
196 | + "1 화\n", | |
197 | + "2 수\n", | |
198 | + "3 목\n", | |
199 | + "4 금\n", | |
200 | + "dtype: object" | |
201 | + ] | |
202 | + }, | |
203 | + "execution_count": 11, | |
204 | + "metadata": {}, | |
205 | + "output_type": "execute_result" | |
206 | + } | |
207 | + ], | |
208 | + "source": [ | |
209 | + "sr5 = pd.Series(['월', '화', '수', '목', '금'])\n", | |
210 | + "sr5" | |
211 | + ] | |
212 | + }, | |
213 | + { | |
214 | + "cell_type": "code", | |
215 | + "execution_count": 12, | |
216 | + "id": "cd3aead2", | |
217 | + "metadata": {}, | |
218 | + "outputs": [ | |
219 | + { | |
220 | + "data": { | |
221 | + "text/plain": [ | |
222 | + "1반 10\n", | |
223 | + "2반 20\n", | |
224 | + "3반 30\n", | |
225 | + "4반 40\n", | |
226 | + "5반 50\n", | |
227 | + "dtype: int64" | |
228 | + ] | |
229 | + }, | |
230 | + "execution_count": 12, | |
231 | + "metadata": {}, | |
232 | + "output_type": "execute_result" | |
233 | + } | |
234 | + ], | |
235 | + "source": [ | |
236 | + "sr6 = pd.Series(data1, index = data2)\n", | |
237 | + "sr6" | |
238 | + ] | |
239 | + }, | |
240 | + { | |
241 | + "cell_type": "code", | |
242 | + "execution_count": null, | |
243 | + "id": "2788f969", | |
244 | + "metadata": {}, | |
245 | + "outputs": [], | |
246 | + "source": [] | |
247 | + }, | |
248 | + { | |
249 | + "cell_type": "code", | |
250 | + "execution_count": null, | |
251 | + "id": "a34ac7f5", | |
252 | + "metadata": {}, | |
253 | + "outputs": [], | |
254 | + "source": [] | |
255 | + }, | |
256 | + { | |
257 | + "cell_type": "code", | |
258 | + "execution_count": null, | |
259 | + "id": "00e7827e", | |
260 | + "metadata": {}, | |
261 | + "outputs": [], | |
262 | + "source": [] | |
263 | + }, | |
264 | + { | |
265 | + "cell_type": "code", | |
266 | + "execution_count": null, | |
267 | + "id": "96f6d46f", | |
268 | + "metadata": {}, | |
269 | + "outputs": [], | |
270 | + "source": [] | |
271 | + }, | |
272 | + { | |
273 | + "cell_type": "code", | |
274 | + "execution_count": null, | |
275 | + "id": "522bccf9", | |
276 | + "metadata": {}, | |
277 | + "outputs": [], | |
278 | + "source": [] | |
279 | + }, | |
280 | + { | |
281 | + "cell_type": "code", | |
282 | + "execution_count": 14, | |
283 | + "id": "1f41dc16", | |
284 | + "metadata": {}, | |
285 | + "outputs": [ | |
286 | + { | |
287 | + "data": { | |
288 | + "text/plain": [ | |
289 | + "0 80\n", | |
290 | + "1 90\n", | |
291 | + "2 60\n", | |
292 | + "dtype: int64" | |
293 | + ] | |
294 | + }, | |
295 | + "execution_count": 14, | |
296 | + "metadata": {}, | |
297 | + "output_type": "execute_result" | |
298 | + } | |
299 | + ], | |
300 | + "source": [ | |
301 | + "pd.Series([80, 90, 60])" | |
302 | + ] | |
303 | + }, | |
304 | + { | |
305 | + "cell_type": "code", | |
306 | + "execution_count": 15, | |
307 | + "id": "c1fb87da", | |
308 | + "metadata": {}, | |
309 | + "outputs": [ | |
310 | + { | |
311 | + "data": { | |
312 | + "text/plain": [ | |
313 | + "국 80\n", | |
314 | + "영 90\n", | |
315 | + "수 60\n", | |
316 | + "dtype: int64" | |
317 | + ] | |
318 | + }, | |
319 | + "execution_count": 15, | |
320 | + "metadata": {}, | |
321 | + "output_type": "execute_result" | |
322 | + } | |
323 | + ], | |
324 | + "source": [ | |
325 | + "pd.Series([80, 90, 60], index=['국','영', '수'])" | |
326 | + ] | |
327 | + }, | |
328 | + { | |
329 | + "cell_type": "code", | |
330 | + "execution_count": null, | |
331 | + "id": "d57af4fa", | |
332 | + "metadata": {}, | |
333 | + "outputs": [], | |
334 | + "source": [] | |
335 | + }, | |
336 | + { | |
337 | + "cell_type": "code", | |
338 | + "execution_count": null, | |
339 | + "id": "1dbde3c0", | |
340 | + "metadata": {}, | |
341 | + "outputs": [], | |
342 | + "source": [] | |
343 | + }, | |
344 | + { | |
345 | + "cell_type": "code", | |
346 | + "execution_count": null, | |
347 | + "id": "873f52ff", | |
348 | + "metadata": {}, | |
349 | + "outputs": [], | |
350 | + "source": [] | |
351 | + }, | |
352 | + { | |
353 | + "cell_type": "code", | |
354 | + "execution_count": null, | |
355 | + "id": "3e7b5fa9", | |
356 | + "metadata": {}, | |
357 | + "outputs": [], | |
358 | + "source": [] | |
359 | + } | |
360 | + ], | |
361 | + "metadata": { | |
362 | + "kernelspec": { | |
363 | + "display_name": "Python 3 (ipykernel)", | |
364 | + "language": "python", | |
365 | + "name": "python3" | |
366 | + }, | |
367 | + "language_info": { | |
368 | + "codemirror_mode": { | |
369 | + "name": "ipython", | |
370 | + "version": 3 | |
371 | + }, | |
372 | + "file_extension": ".py", | |
373 | + "mimetype": "text/x-python", | |
374 | + "name": "python", | |
375 | + "nbconvert_exporter": "python", | |
376 | + "pygments_lexer": "ipython3", | |
377 | + "version": "3.9.7" | |
378 | + } | |
379 | + }, | |
380 | + "nbformat": 4, | |
381 | + "nbformat_minor": 5 | |
382 | +} |
+++ 20220418/score.csv
... | ... | @@ -0,0 +1,3 @@ |
1 | +,1,2,3 | |
2 | +middle,89.2,92.5,90.8 | |
3 | +final,92.8,89.9,95.2 |
+++ 20220418/score2.csv
... | ... | @@ -0,0 +1,3 @@ |
1 | +,1,2,3 | |
2 | +middle,89.2,92.5,90.8 | |
3 | +final,92.8,89.9,95.2 |
+++ 20220418/score3.csv
... | ... | @@ -0,0 +1,3 @@ |
1 | +,1,2,3 | |
2 | +middle,89.2,92.5,90.8 | |
3 | +final,92.8,89.9,95.2 |
+++ 20220418/score4.csv
... | ... | @@ -0,0 +1,3 @@ |
1 | +,1,2,3 | |
2 | +middle,89.2,92.5,90.8 | |
3 | +final,92.8,89.9,95.2 |
+++ 20220418/score5.csv
... | ... | @@ -0,0 +1,3 @@ |
1 | +,1,2,3 | |
2 | +middle,89.2,92.5,90.8 | |
3 | +final,92.8,89.9,95.2 |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?