VS Code Python Tool Now Does Native Notebooks

The Python Extension for VS Code Insiders team is previewing the newest implementation of notebooks, used frequently in data science with offerings such as Jupyter Notebooks.

That newest implementation is called Native Notebooks, and it leverages the Native Notebooks API to revamp the data science experience in Microsoft's open source, cross-platform code editor that for years has fully embraced Python, used often for data science projects. Notebooks are used to create interactive environments -- such as documents or canvases -- that can include source code and markdown and other media.

"The Notebook API allows Visual Studio Code extensions to open files as notebooks, execute notebook code cells, and render notebook outputs in a variety of rich and interactive formats," Microsoft's documentation says. It further notes that the Notebook API seeks to enable experiences inside VS Code similar to those found when using popular notebook interfaces like Jupyter Notebook or Google Colab.

The Notebook API
[Click on image for larger view.] The Notebook API (source: Microsoft).

Three main features of the new experience include:

  • Improved integration between extensions in notebooks: Developers can now use the same extensions for editing source code or markdown text in the VS Code Editor from within notebooks "For example, you won't miss your VIM key bindings or your stylishly colored brackets anymore."
  • Improved load times: This is illustrated by an example notebook that builds and assesses the accuracy of an image recognition model that differentiates between dog breeds contains 49 code cells, 18 markdown cells, and their outputs (~5MB). "The current notebook editor takes about 7 seconds to open this notebook, but the new notebook editor takes less than a second!"
  • New interface: This sports a fresh look and feel along with other UI changes and cell manipulation capabilities that match VS Code's design language.

Other new features range from file management functionality to highly requested shortcuts to quick cell manipulation enhancements, which are detailed in the post along with guidance about how to try Native Notebooks with the VS Code Insiders build.

Going forward, program manager Claudia Regio said in a July 27 blog post, the team will seek to ensure feature parity with the existing Python notebooks experience by implementing features and functionality such as:

  • Data viewer
  • Variable explorer
  • Run-by-line (see here)
  • Gather (see here)

Other feature suggestions can be made at the GitHub repo.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus


  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube