Notice
Recent Posts
Recent Comments
Tags
- fig ax 사용
- TOC
- 티스토리 목차
- magic command
- tistory toc
- matplotlib 객제 지향 방식
- jupyter notebook shell commands
- tistory 목차
- 티스토리 자동 목차
- NewYork Times 읽기
05-10 20:29
Archives
develop myself
jupyter notebook magic commands, shell commands 본문
magic commands
IPython의 기능. 즉, interactive 환경에서 사용한다.
주로 jupyter notebook에서 사용.
python 구문을 확장한 기능.%
로 시작하여 사용
- line magics:
%
로 시작하여 사용. 한 문장을 실행. - cell magics:
%%
로 시작하여 사용. 한 셀을 실행
주요 magic commands
%matplotlib inline
# delete all variables in namespace
%reset
%run myscript.py
%timeit L = [n ** 2 for n in range(1000)]
%%timeit
L = []
for n in range(1000):
L.append(n ** 2)
help
특정 magic command의 문서를 확인
%timeit?
magic command의 전반적인 문서 확인
%magic
사용가능한 magic command 확인
%lsmagic
공식 문서
- jupyter magic command: https://jupyter-tutorial.readthedocs.io/en/stable/workspace/ipython/magics.html
- IPython magic command: https://ipython.readthedocs.io/en/stable/interactive/magics.html
shell commands
IPython의 기능.
UNIX/Linux commands를 interactive 환경에서 사용가능하게 하는 기능.!
로 시작하여 사용.
주요 shell commands
!ls
!pwd
!cat filename.txt
이외에도 많은 Linux 명령어들을 사용할 수 있다.
jupyter 공식문서
https://jupyter-tutorial.readthedocs.io/en/stable/workspace/ipython/shell.html
Shell commands in IPython - Jupyter Tutorial 0.9.0
Previous IPython magic
jupyter-tutorial.readthedocs.io
'DataScience > Python' 카테고리의 다른 글
matplotlib basic tips (0) | 2023.01.26 |
---|---|
pandas basic tips (0) | 2023.01.26 |
numpy basic tips (0) | 2023.01.26 |
Python help, dir (0) | 2023.01.26 |
Python formatting: format() method, f-string (0) | 2023.01.25 |
Comments