Jupyter) ClearOutput 방법 소개(command, in cell)

2021. 7. 23. 20:21꿀팁 분석 환경 설정/Jupyter Notebook & Lab

728x90

 

목차

    quick hack

    Change the cell type to raw then back to code: Esc R Y will discard the output.

     

    특정 셀에서 초기화(in cell)

    from IPython.display import clear_output
    clear_output(wait=True)

    Jupyer Lab 사용자는 아래와 같이 추가

    {
    "shortcuts": [
            {
                "command": "notebook:hide-cell-outputs",
                "keys": [
                    "H"
                ],
                "selector": ".jp-Notebook:focus"
            },
            {
                "command": "notebook:show-cell-outputs",
                "keys": [
                    "Shift H"
                ],
                "selector": ".jp-Notebook:focus"
            }
        ]
    }

    Command

    용량이 아주 커서 열지 못하는 경우 command로 초기화시켜야 함

    abc.ipynb를 초기화하는 방법은 다음과 같음

     

    jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace abc.ipynb

     

     

     

     

    https://stackoverflow.com/questions/39924826/keyboard-shortcut-to-clear-cell-output-in-jupyter-notebook

     

    Keyboard shortcut to clear cell output in Jupyter notebook

    Does anyone know what is the keyboard shortcut to clear (not toggle) the cell output in Jupyter Notebook?

    stackoverflow.com

     

    728x90