일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- Repository
- Spring
- Session
- 머신러닝
- imread
- 저장소
- 이미지
- data
- Java
- 파이썬
- CLONE
- Linux
- Python
- model
- datascience
- opencv
- 함수
- gitignore
- r
- db
- AI
- tensorflow
- list
- 가중치
- Anaconda
- branch
- destroyallwindows
- git
- imshow
- Vector
- Today
- Total
AI학교
모듈 본문
많이 쓰는 모듈 - 관례상 별칭
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
디렉터리 = 패키지
모듈 로드시 초기화 코드
__init__
import adv_flowcontrol
모듈의 이름 : adv_flowcontrol
import adv_function
fun : <class 'function'>
is fun callable ? True
200
11
12
13
15
15
고정인자 : 1 2
가변인자 : (3, 4, 5, 6)
키워드 인자 : {'option1': '옵션1', 'option2': '옵션2'}
option 1이 옵션1로 설정되었습니다.
30
-10
200
Words : ['life', 'is', 'too', 'short', 'you', 'need', 'python']
Sorted Words : ['python', 'short', 'life', 'need', 'too', 'you', 'is']
nums: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
Sorted num % 4 ASC: [4, 8, 12, 16, 20, 1, 5, 9, 13, 17, 2, 6, 10, 14, 18, 3, 7, 11, 15, 19]
adv_function.get_total(1, 2, 3, 4, 5, 6)
:
21
from adv_function import get_total
get_total.__module__
:
'adv_function'
dir(adv_function)
:
['__builtins__',
'__cached__',
'__doc__',
'__file__',
'__loader__',
'__name__',
'__package__',
'__spec__',
'calc',
'fun',
'func_args',
'get_total',
'incr',
'minus',
'nums',
'plus',
'scope_func',
'scope_func2',
'scope_func3',
'sorted_words',
'times',
'words',
'x']
print(get_total(1,2,3,4,5,"python"))