There was an article about VS Code's Jupyter notebook in the magazine, so I tried it. It was very easy to experience Jupyter notebook, so make a note of your footprints.
--I tried it on Mac. --In homebrew, python is already installed as python3. --Pip3 is also included when python3 is installed
python3
$ which python3
/usr/local/bin/python3
$ python3 --version
Python 3.7.5
pip3
$ which pip3
/usr/local/bin/pip3
$ pip3 --version
pip 19.3.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
ipython module also includes notebook
$ pip3 install "ipython[notebook]"
↑ On Mac, I was able to do it smoothly without any problems, but on Windows7 + python3.8.0, it failed at the module called pywinpty. It worked fine on Windows7 + python3.7.4.
Put Python in VSCode Extension
Execute the following command of VSCode to select the Python module to be used in the operation.
Select Interpreter
![スクリーンショット 2019-11-21 20.16.44.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/435600/8b804dc9-855b-3ea9-b633-1c2903497de6.png)
You will be asked which Python to use, so select python3 that you put in with brew
```/usr/local/bin/python3```
Choose
Execute the following command of VSCode to start it.
#### **` Create New Blank Jupyter notebook`**
```python
![スクリーンショット 2019-11-21 20.19.08.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/435600/7be8f0fe-bb24-66a3-152e-5ab77bc13ce2.png)
## Try out
Install the module to be used this time with pip3
$ pip3 install pandas
Sample I made
import pandas as pd df = pd.DataFrame([[0, 5, 1],[2, 2, 2]], index=['a', 'b'], columns=['A', 'B', 'C']) df
It worked like this
![スクリーンショット 2019-11-21 20.22.13.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/435600/2c4b6c15-deaf-ca0c-88ae-c0cfd4d197c7.png)
## Try it (extra edition)
The output of pandas looks like something ...
What was that….
Uh, my head ...
…。
This is it! !!
![キャプチャ.PNG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/435600/40560e23-de8b-f8ae-18b6-dc04e76f19c1.png)
Baseball scoreboard! (Excuse me)
Recommended Posts