#1 目的
Jupyterで書いたコードの折り畳みを行うためには、Nbextensionsをアドオンする必要がありますが、多少手間がかかるので、やり方をメモしておきます。なお、ここではWindowsでのやり方を書いています。
#2 やり方
(1)Anaconda Promptをオープンします。

(2)Nbextensionsをインストールする。Anaconda Promptに下記を入力する。
pip install jupyter-contrib-nbextensions
jupyter contrib nbextension install --user
(3)インストール完了後、「Jupyter」のメニューに「Nbextensions」が追加されていることを確認する。確認後、「Nbextensions」をクリックしてConfig画面をオープンする。

(4)「Nbextensions」の画面にて「Codefolding」にチェックを入れる。下記のキャプチャー図と同じ状態にする。

(5)コードを開くと、折り畳みができるようになっている。(折り畳みができない場合は一度jupyterを終了させて再度起動するといい。)
