728x90
Feel the bliss of automated imports[1]
- 데이터 분석을 위해 프로그램을 작성할 때 기본적으로 임포트해야하는 pandas, numpy, matplotlib, sklearn 등의 라이브러리들이 있음
- pyforest는 여러 줄의 import ~ 를 적는 수고를 덜어줄 수 있는 라이브러리임
- 관습에 따라
pandas as pd
,numpy as np
,matplotlib.pyplot as plt
임포트 해주어 기존에 사용하던 그대로 코드 작성을 하면됨
설치
- jupyter 셀에서 pip을 사용해 설치할 수 있음
!pip install pyforest
적용 예
- import pyforest로 pyforest를 임포트하면 42개의 라이브러리가 자동으로 임포트 됨
- 다음의 방식으로 임포트 된 라이브러리를 확인할 수 있음
dir(pyforest)
: import 된 모든 라이브러리를 반환pyforest.lazy_imports()
: import 되었지만 사용되지 않은 라이브러리의 리스트 반환pyforest.active_imports()
: import되고, 사용중인 라이브러리의 리스트 반환
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Reference
[1] pyforest
[2] Import all Python libraries in one line of code, Satyan Kumar
'프로그래밍 언어 > python' 카테고리의 다른 글
_var, var_, _var_, __var__과 같이 선언된 변수의 의미를 설명 | 2022.07.26 |
---|---|
unittest, Test-driven develope를 위한 라이브러리 | 2022.07.26 |
matplotlib 사용시 메모리 누수 | 2022.07.26 |
보기 좋은 쉼표 배치 | 2022.07.26 |
assert문으로 디버깅 | 2022.07.26 |