Pythonデータ解析環境を構築|Jupyter Notebook,numpy,pandas,matplotlibのイメージ画像

Pythonデータ解析環境を構築|Jupyter Notebook,numpy,pandas,matplotlib

  • 公開日:2018/11/14
  • 更新日:2018/11/14
  • 投稿者:n bit

Pythonでインタラクティブなデータ解析環境を直接構築する方法解説。インストールするパッケージはデータ解析に強い『numpy,pandas,matplotlib』と対話型のユーザインターフェースを提供する『Jupyter Notebook』を使用します。

  • Python

この記事は約 分で読めます。(文字)

Pythonでインタラクティブな分析環境を構築

Pythonで統計分析などを行う環境を構築するにはAnacondaを利用するのが1番簡単。しかしAnacondaを利用したインストールは後々のパッケージ管理や追加作業が必要な場合ハードルが上がるのと、その他の開発環境といちいち切り替えて利用する必要があるため少し面倒です。

そのため今回はpyenv環境にあるPythonにインタラクティブな分析環境を直接インストールして構築していきます。インストールするパッケージは『numpy』、『pandas』、『matplotlib』、『Jupyter Notebook』の4つです。

基本的にはすべてpipコマンドでインストールできます。

$ pip install numpy

$ pip install pandas
$ pip install matplotlib
$ pip install jupyter

それぞれの個別インストール方法やインストール後の動作確認方法を確認したい方は、これより下のコンテンツをご確認ください。

pyenv環境上にPythonがまだインストールできていない方は下記のページを参考にしてそこまでの構築作業を終了させておきましょう。

numpyのインストール

『numpy』は下記のコマンドでインストールします。

$ pip install numpy

numpyのみインストールする場合は上記のpipコマンドでインストールしますが、pandasやmatplotlibもインストールする場合はそちらで合わせてnumpyもインストールしてくれますのでこちらの手順は省いても大丈夫です。

pandasのインストール

『pandas』は下記のコマンドでインストールします。

$ pip install pandas

出力結果

Collecting pandas

Downloading https://files.pythonhosted.org/packages/78/78/50ef81a903eccc4e90e278a143c9a0530f05199f6221d2e1b21025852982/pandas-0.23.4-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (14.6MB)
100% |████████████████████████████████| 14.7MB 1.8MB/s
Collecting pytz>=2011k (from pandas)
Downloading https://files.pythonhosted.org/packages/f8/0e/2365ddc010afb3d79147f1dd544e5ee24bf4ece58ab99b16fbb465ce6dc0/pytz-2018.7-py2.py3-none-any.whl (506kB)
100% |████████████████████████████████| 512kB 2.9MB/s
Requirement already satisfied: numpy>=1.9.0 in /Users/xx/.pyenv/versions/3.6.6/lib/python3.6/site-packages (from pandas) (1.15.2)
Requirement already satisfied: python-dateutil>=2.5.0 in /Users/xx/.pyenv/versions/3.6.6/lib/python3.6/site-packages (from pandas) (2.7.3)
Requirement already satisfied: six>=1.5 in /Users/xx/.pyenv/versions/3.6.6/lib/python3.6/site-packages (from python-dateutil>=2.5.0->pandas) (1.11.0)
Installing collected packages: pytz, pandas
Successfully installed pandas-0.23.4 pytz-2018.7

その他必要となるパッケージが自動的にインストールされます。

既にインストール済みだったパッケージ

  • numpy
  • python-dateutil
  • six

追加でインストールされたパッケージ

  • pytz
  • pandas

matplotlibのインストール

『matplotlib』は下記のコマンドでインストールします。

$ pip install matplotlib

出力結果

Collecting matplotlib

Downloading https://files.pythonhosted.org/packages/28/6c/addb3560777f454b1d56f0020f89e901eaf68a62593d4795e38ddf24bbd6/matplotlib-3.0.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (14.1MB)
100% |████████████████████████████████| 14.1MB 1.6MB/s
Requirement already satisfied: numpy>=1.10.0 in /Users/xx/.pyenv/versions/3.6.6/lib/python3.6/site-packages (from matplotlib) (1.15.2)
Collecting cycler>=0.10 (from matplotlib)
Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil>=2.1 in /Users/xx/.pyenv/versions/3.6.6/lib/python3.6/site-packages (from matplotlib) (2.7.3)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)
Downloading https://files.pythonhosted.org/packages/71/e8/6777f6624681c8b9701a8a0a5654f3eb56919a01a78e12bf3c73f5a3c714/pyparsing-2.3.0-py2.py3-none-any.whl (59kB)
100% |████████████████████████████████| 61kB 1.7MB/s
Collecting kiwisolver>=1.0.1 (from matplotlib)
Downloading https://files.pythonhosted.org/packages/fb/96/619db9bf08f652790fa9f3c3884a67dc43da4bdaa185a5aa2117eb4651e1/kiwisolver-1.0.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (108kB)
100% |████████████████████████████████| 112kB 1.5MB/s
Requirement already satisfied: six in /Users/xx/.pyenv/versions/3.6.6/lib/python3.6/site-packages (from cycler>=0.10->matplotlib) (1.11.0)
Requirement already satisfied: setuptools in /Users/xx/.pyenv/versions/3.6.6/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib) (39.0.1)
Installing collected packages: cycler, pyparsing, kiwisolver, matplotlib
Successfully installed cycler-0.10.0 kiwisolver-1.0.1 matplotlib-3.0.2 pyparsing-2.3.0

その他必要となるパッケージが自動的にインストールされます。

既にインストール済みだったパッケージ

  • numpy
  • python-dateutil
  • six
  • setuptools

追加でインストールされたパッケージ

  • cycler
  • pyparsing
  • kiwisolver
  • matplotlib

以前はmatplotlibのインストールは鬼門だったのですが以前ほど必要なパッケージがなくなったのか簡単に正常インストールできるようになりました。

Jupyter Notebookをインストール

『Jupyter Notebook』は下記のコマンドでインストールします。

$ pip install jupyter

出力結果

Collecting jupyter

Downloading https://files.pythonhosted.org/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl
Collecting notebook (from jupyter)
Downloading https://files.pythonhosted.org/packages/44/16/9f108b675828c4117cfe72d8d0f97094163c40584e40c46ec48a1e862693/notebook-5.7.0-py2.py3-none-any.whl (9.0MB)
100% |████████████████████████████████| 9.0MB 1.6MB/s
Collecting ipywidgets (from jupyter)
Downloading https://files.pythonhosted.org/packages/30/9a/a008c7b1183fac9e52066d80a379b3c64eab535bd9d86cdc29a0b766fd82/ipywidgets-7.4.2-py2.py3-none-any.whl (111kB)
100% |████████████████████████████████| 112kB 1.2MB/s
Collecting jupyter-console (from jupyter)
Downloading https://files.pythonhosted.org/packages/cb/ee/6374ae8c21b7d0847f9c3722dcdfac986b8e54fa9ad9ea66e1eb6320d2b8/jupyter_console-6.0.0-py2.py3-none-any.whl
Collecting ipykernel (from jupyter)
Downloading https://files.pythonhosted.org/packages/d8/b0/f0be5c5ab335196f5cce96e5b889a4fcf5bfe462eb0acc05cd7e2caf65eb/ipykernel-5.1.0-py3-none-any.whl (113kB)
100% |████████████████████████████████| 122kB 1.7MB/s
Collecting nbconvert (from jupyter)
Downloading https://files.pythonhosted.org/packages/b5/bb/94c493051d60e5b9c0f7f9a368b324201818c1b1c4cae85d1e49a41846c7/nbconvert-5.4.0-py2.py3-none-any.whl (405kB)
100% |████████████████████████████████| 409kB 1.9MB/s
Collecting qtconsole (from jupyter)
Downloading https://files.pythonhosted.org/packages/e0/7a/8aefbc0ed078dec7951ac9a06dcd1869243ecd7bcbce26fa47bf5e469a8f/qtconsole-4.4.3-py2.py3-none-any.whl (113kB)
100% |████████████████████████████████| 122kB 2.5MB/s
Collecting tornado>=4 (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/e6/78/6e7b5af12c12bdf38ca9bfe863fcaf53dc10430a312d0324e76c1e5ca426/tornado-5.1.1.tar.gz (516kB)
100% |████████████████████████████████| 522kB 2.1MB/s
Collecting pyzmq>=17 (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/24/a9/7619afa48606e6cfe345c124f31942698c0c066f133c98c2dcbe72018349/pyzmq-17.1.2-cp36-cp36m-macosx_10_6_intel.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 2.2MB/s
Collecting nbformat (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/da/27/9a654d2b6cc1eaa517d1c5a4405166c7f6d72f04f6e7eea41855fe808a46/nbformat-4.4.0-py2.py3-none-any.whl (155kB)
100% |████████████████████████████████| 163kB 2.0MB/s
Collecting jinja2 (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl (126kB)
100% |████████████████████████████████| 133kB 1.6MB/s
Collecting prometheus-client (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/61/84/9aa657b215b04f21a72ca8e50ff159eef9795096683e4581a357baf4dde6/prometheus_client-0.4.2.tar.gz
Collecting ipython-genutils (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/fa/bc/9bd3b5c2b4774d5f33b2d544f1460be9df7df2fe42f352135381c347c69a/ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting traitlets>=4.2.1 (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/93/d6/abcb22de61d78e2fc3959c964628a5771e47e7cc60d53e9342e21ed6cc9a/traitlets-4.3.2-py2.py3-none-any.whl (74kB)
100% |████████████████████████████████| 81kB 1.7MB/s
Collecting Send2Trash (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/49/46/c3dc27481d1cc57b9385aff41c474ceb7714f7935b1247194adae45db714/Send2Trash-1.5.0-py3-none-any.whl
Collecting jupyter-client>=5.2.0 (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/94/dd/fe6c4d683b09eb05342bd2816b7779663f71762b4fa9c2d5203d35d17354/jupyter_client-5.2.3-py2.py3-none-any.whl (89kB)
100% |████████████████████████████████| 92kB 1.3MB/s
Collecting terminado>=0.8.1 (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/2e/20/a26211a24425923d46e1213b376a6ee60dc30bcdf1b0c345e2c3769deb1c/terminado-0.8.1-py2.py3-none-any.whl
Collecting jupyter-core>=4.4.0 (from notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/1d/44/065d2d7bae7bebc06f1dd70d23c36da8c50c0f08b4236716743d706762a8/jupyter_core-4.4.0-py2.py3-none-any.whl (126kB)
100% |████████████████████████████████| 133kB 1.4MB/s
Collecting ipython>=4.0.0; python_version >= "3.3" (from ipywidgets->jupyter)
Downloading https://files.pythonhosted.org/packages/1b/e2/ffb8c1b574f972cf4183b0aac8f16b57f1e3bbe876b31555b107ea3fd009/ipython-7.1.1-py3-none-any.whl (764kB)
100% |████████████████████████████████| 768kB 2.3MB/s
Collecting widgetsnbextension~=3.4.0 (from ipywidgets->jupyter)
Downloading https://files.pythonhosted.org/packages/8a/81/35789a3952afb48238289171728072d26d6e76649ddc8b3588657a2d78c1/widgetsnbextension-3.4.2-py2.py3-none-any.whl (2.2MB)
100% |████████████████████████████████| 2.2MB 2.6MB/s
Collecting pygments (from jupyter-console->jupyter)
Downloading https://files.pythonhosted.org/packages/02/ee/b6e02dc6529e82b75bb06823ff7d005b141037cb1416b10c6f00fc419dca/Pygments-2.2.0-py2.py3-none-any.whl (841kB)
100% |████████████████████████████████| 849kB 2.3MB/s
Collecting prompt-toolkit<2.1.0,>=2.0.0 (from jupyter-console->jupyter)
Downloading https://files.pythonhosted.org/packages/d1/e6/adb3be5576f5d27c6faa33f1e9fea8fe5dbd9351db12148de948507e352c/prompt_toolkit-2.0.7-py3-none-any.whl (338kB)
100% |████████████████████████████████| 348kB 2.5MB/s
Collecting pandocfilters>=1.4.1 (from nbconvert->jupyter)
Downloading https://files.pythonhosted.org/packages/4c/ea/236e2584af67bb6df960832731a6e5325fd4441de001767da328c33368ce/pandocfilters-1.4.2.tar.gz
Collecting bleach (from nbconvert->jupyter)
Downloading https://files.pythonhosted.org/packages/d4/0d/4696373c3b714f6022d668fbab619690a42050dbeacede6d10ed97fbd3e2/bleach-3.0.2-py2.py3-none-any.whl (148kB)
100% |████████████████████████████████| 153kB 1.7MB/s
Collecting entrypoints>=0.2.2 (from nbconvert->jupyter)
Downloading https://files.pythonhosted.org/packages/cc/8b/4eefa9b47f1910b3d2081da67726b066e379b04ca897acfe9f92bac56147/entrypoints-0.2.3-py2.py3-none-any.whl
Collecting mistune>=0.8.1 (from nbconvert->jupyter)
Downloading https://files.pythonhosted.org/packages/09/ec/4b43dae793655b7d8a25f76119624350b4d65eb663459eb9603d7f1f0345/mistune-0.8.4-py2.py3-none-any.whl
Collecting testpath (from nbconvert->jupyter)
Downloading https://files.pythonhosted.org/packages/be/a4/162f9ebb6489421fe46dcca2ae420369edfee4b563c668d93cb4605d12ba/testpath-0.4.2-py2.py3-none-any.whl (163kB)
100% |████████████████████████████████| 163kB 1.7MB/s
Collecting defusedxml (from nbconvert->jupyter)
Using cached https://files.pythonhosted.org/packages/87/1c/17f3e3935a913dfe2a5ca85fa5ccbef366bfd82eb318b1f75dadbf0affca/defusedxml-0.5.0-py2.py3-none-any.whl
Collecting jsonschema!=2.5.0,>=2.4 (from nbformat->notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/77/de/47e35a97b2b05c2fadbec67d44cfcdcd09b8086951b331d82de90d2912da/jsonschema-2.6.0-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2->notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/da/fc/2979c425ad23d528d6ac2e1f3efdc28e572fa1e1fbd5a75171cbdd7ddaa5/MarkupSafe-1.1.0-cp36-cp36m-macosx_10_6_intel.whl
Requirement already satisfied: six in /Users/xx/.pyenv/versions/3.6.6/lib/python3.6/site-packages (from traitlets>=4.2.1->notebook->jupyter) (1.11.0)
Collecting decorator (from traitlets>=4.2.1->notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/bc/bb/a24838832ba35baf52f32ab1a49b906b5f82fb7c76b2f6a7e35e140bac30/decorator-4.3.0-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil>=2.1 in /Users/xx/.pyenv/versions/3.6.6/lib/python3.6/site-packages (from jupyter-client>=5.2.0->notebook->jupyter) (2.7.3)
Collecting ptyprocess; os_name != "nt" (from terminado>=0.8.1->notebook->jupyter)
Downloading https://files.pythonhosted.org/packages/d1/29/605c2cc68a9992d18dada28206eeada56ea4bd07a239669da41674648b6f/ptyprocess-0.6.0-py2.py3-none-any.whl
Collecting pickleshare (from ipython>=4.0.0; python_version >= "3.3"->ipywidgets->jupyter)
Downloading https://files.pythonhosted.org/packages/9a/41/220f49aaea88bc6fa6cba8d05ecf24676326156c23b991e80b3f2fc24c77/pickleshare-0.7.5-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=18.5 in /Users/xx/.pyenv/versions/3.6.6/lib/python3.6/site-packages (from ipython>=4.0.0; python_version >= "3.3"->ipywidgets->jupyter) (39.0.1)
Collecting backcall (from ipython>=4.0.0; python_version >= "3.3"->ipywidgets->jupyter)
Downloading https://files.pythonhosted.org/packages/84/71/c8ca4f5bb1e08401b916c68003acf0a0655df935d74d93bf3f3364b310e0/backcall-0.1.0.tar.gz
Collecting appnope; sys_platform == "darwin" (from ipython>=4.0.0; python_version >= "3.3"->ipywidgets->jupyter)
Downloading https://files.pythonhosted.org/packages/87/a9/7985e6a53402f294c8f0e8eff3151a83f1fb901fa92909bb3ff29b4d22af/appnope-0.1.0-py2.py3-none-any.whl
Collecting pexpect; sys_platform != "win32" (from ipython>=4.0.0; python_version >= "3.3"->ipywidgets->jupyter)
Downloading https://files.pythonhosted.org/packages/89/e6/b5a1de8b0cc4e07ca1b305a4fcc3f9806025c1b651ea302646341222f88b/pexpect-4.6.0-py2.py3-none-any.whl (57kB)
100% |████████████████████████████████| 61kB 1.8MB/s
Collecting jedi>=0.10 (from ipython>=4.0.0; python_version >= "3.3"->ipywidgets->jupyter)
Downloading https://files.pythonhosted.org/packages/7a/1a/9bd24a185873b998611c2d8d4fb15cd5e8a879ead36355df7ee53e9111bf/jedi-0.13.1-py2.py3-none-any.whl (177kB)
100% |████████████████████████████████| 184kB 1.8MB/s
Collecting wcwidth (from prompt-toolkit<2.1.0,>=2.0.0->jupyter-console->jupyter)
Downloading https://files.pythonhosted.org/packages/7e/9f/526a6947247599b084ee5232e4f9190a38f398d7300d866af3ab571a5bfe/wcwidth-0.1.7-py2.py3-none-any.whl
Collecting webencodings (from bleach->nbconvert->jupyter)
Downloading https://files.pythonhosted.org/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl
Collecting parso>=0.3.0 (from jedi>=0.10->ipython>=4.0.0; python_version >= "3.3"->ipywidgets->jupyter)
Downloading https://files.pythonhosted.org/packages/09/51/9c48a46334be50c13d25a3afe55fa05c445699304c5ad32619de953a2305/parso-0.3.1-py2.py3-none-any.whl (88kB)
100% |████████████████████████████████| 92kB 1.6MB/s
Building wheels for collected packages: tornado, prometheus-client, pandocfilters, backcall
Running setup.py bdist_wheel for tornado ... done
Stored in directory: /Users/xx/Library/Caches/pip/wheels/6d/e1/ce/f4ee2fa420cc6b940123c64992b81047816d0a9fad6b879325
Running setup.py bdist_wheel for prometheus-client ... done
Stored in directory: /Users/xx/Library/Caches/pip/wheels/b9/96/bc/e2acadc6bbfe57a1f631a34ca4ce6dd057af059b8d6878202b
Running setup.py bdist_wheel for pandocfilters ... done
Stored in directory: /Users/xx/Library/Caches/pip/wheels/39/01/56/f1b08a6275acc59e846fa4c1e1b65dbc1919f20157d9e66c20
Running setup.py bdist_wheel for backcall ... done
Stored in directory: /Users/xx/Library/Caches/pip/wheels/98/b0/dd/29e28ff615af3dda4c67cab719dd51357597eabff926976b45
Successfully built tornado prometheus-client pandocfilters backcall
Installing collected packages: tornado, pyzmq, ipython-genutils, decorator, traitlets, jupyter-core, jsonschema, nbformat, MarkupSafe, jinja2, jupyter-client, pygments, pickleshare, wcwidth, prompt-toolkit, backcall, appnope, ptyprocess, pexpect, parso, jedi, ipython, ipykernel, prometheus-client, Send2Trash, pandocfilters, webencodings, bleach, entrypoints, mistune, testpath, defusedxml, nbconvert, terminado, notebook, widgetsnbextension, ipywidgets, jupyter-console, qtconsole, jupyter
Successfully installed MarkupSafe-1.1.0 Send2Trash-1.5.0 appnope-0.1.0 backcall-0.1.0 bleach-3.0.2 decorator-4.3.0 defusedxml-0.5.0 entrypoints-0.2.3 ipykernel-5.1.0 ipython-7.1.1 ipython-genutils-0.2.0 ipywidgets-7.4.2 jedi-0.13.1 jinja2-2.10 jsonschema-2.6.0 jupyter-1.0.0 jupyter-client-5.2.3 jupyter-console-6.0.0 jupyter-core-4.4.0 mistune-0.8.4 nbconvert-5.4.0 nbformat-4.4.0 notebook-5.7.0 pandocfilters-1.4.2 parso-0.3.1 pexpect-4.6.0 pickleshare-0.7.5 prometheus-client-0.4.2 prompt-toolkit-2.0.7 ptyprocess-0.6.0 pygments-2.2.0 pyzmq-17.1.2 qtconsole-4.4.3 terminado-0.8.1 testpath-0.4.2 tornado-5.1.1 traitlets-4.3.2 wcwidth-0.1.7 webencodings-0.5.1 widgetsnbextension-3.4.2

その他必要となるパッケージが自動的に合わせてインストールされます。

さすがに数が多いので抽出作業までは行っていません。自動的にインストールされるパッケージが何か確認したい方は上記の出力結果をご確認ください。

インストール後の動作確認

インストールしたパッケージをインポートして正常に動作するか確認します。

$ python

Python 3.6.6 (default, Oct 16 2018, 00:49:38)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.10.44.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.


>>> import numpy
>>> import pandas
>>> import matplotlib
>>>

何もエラーが出ずインポートできれば正しくインストールできています。

Jupyter Notebookを起動

『Jupyter Notebook』を実際に起動して正しくインストールできているか確認してみましょう。

$ jupyter notebook

出力結果

[I 21:23:12.615 NotebookApp] Writing notebook server cookie secret to /Users/xx/Library/Jupyter/runtime/notebook_cookie_secret

[I 21:23:13.618 NotebookApp] Serving notebooks from local directory: /Users/xx/Documents/DIR_jupyter_notebook
[I 21:23:13.618 NotebookApp] The Jupyter Notebook is running at:
[I 21:23:13.618 NotebookApp] http://localhost:8888/?token=00000000000000000000000000000000000000000000000
[I 21:23:13.619 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 21:23:13.620 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=00000000000000000000000000000000000000000000000
[I 21:23:13.964 NotebookApp] Accepting one-time-token-authenticated connection from ::1

と表示させたらブラウザを起動してURLに書き込み入力してください。

  • http://localhost:8888/tree

以下の画面が表示されましたら正しくインストールできています。

jupyter notebook

今日のdot

これでPythonを使ったインタラクティブなデータ分析環境が構築できました。『Jupyter Notebook』を使えば対話的にコードの入出力を行い、すぐに結果を確認することができるためストレスなくデータ分析を行うことができます。

numpyやpandasは動作処理も早いためかなり強力なデータ分析環境です。他の講座で利用方法なども後々解説していきます。