jupyter.org

Jupyter Notebook in Visual Studio Code

Bikash Sundaray
2 min readApr 20, 2018

--

People who work in Python, they love to do their research and experiments in Jupyter Notebook. I am a fan of desktop editors like VS Code, Atom and Sublime. My intention was to get jupyter like feature in Visual Studio code. This is what this article is all about.

Jupyter Notebook: Its an editor and to be precise its a web-based editor designed for python (Aka iPython). Previously Jupyter notebook was known as iPython. It’s open Source, everyone around the globe use it.

Best Features of Jupyter Notebook:

  1. You can run part of code (It’s not required to run the entire script to see the code changes output), just press shift+Enter, where you expect to see new output
  2. See Outputs like Graphs, Analytics, CSV viewer in Editor it-self.
  3. It runs on Browser

How to get this feature in VS Code:

  • Install Visual Studio Code Editor
  • Goto Extension (In the Left Sidebar) and install following extension
jupyter
python
  • Reload/Restart the Editor
  • Write following code click on “Run Cell” to see the output

Remember Run Cell will appear where you have written “#%%”. So you can repeat “#%%” where ever you want. Following code sample for you

#%%
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np

x = np.linspace(0, 20, 100)
plt.plot(x, np.sin(x))
plt.show()

See sample output. So it works like Jupyter (Upto some extent i am happy with this)

Bikash’s Visual Studio

--

--

Bikash Sundaray

AI is my Passion and Innovation is my Energy. I work on ML, IoT, DevOps, Backend, Cloud, Mobile Apps, Security and Frontend