-
[Python Programming 기초] # 모듈의 이해 및 사용Programming Language/Python 2020. 11. 18. 00:33
# 모듈(=외부 라이브러리)의 이해 및 사용
: 다양한 기능들이 미리 함수로 구현되어 모듈 형태로 제공
ex) requests, numpy, pandas
- import : 모듈 전체를 가져올 때 사용
ex) import math
math.pi
- from 모듈 import 값, 함수, 클래스 : 해당 모듈에서 특정한 값, 함수, 클래스만 가져올 때
ex) from math import pi
pi
- * import (star import) : 해당 모듈내에 정의된 모든 것을 import → 권장 X
ex) from math import *
- as : 모듈 import 시, alias(별명) 지정 가능
ex) import math as m
m.exp(3)
본 포스팅은 Fast Campus 머신러닝과 데이터 분석 A-Z 강의를
듣고 정리한 내용을 담고 있습니다.
'Programming Language > Python' 카테고리의 다른 글
[Python] 얼핏 헷갈리는 소소한 용어들 (0) 2021.04.15 [Python Programming 기초] # Class(클래스)와 Object(객체) : 개념 (0) 2020.11.18 [Python Programming 기초] # 함수의 이해 및 사용 2 : lambda 함수 (0) 2020.11.18 [Python Programming 기초] # 함수의 이해 및 사용 1 : def (0) 2020.11.18 [Python Programming 기초] # 조건문과 반복문 3 : for (0) 2020.11.18