A Natural Fit for Data Science — Visual Studio Magazine


VS Code and Python: A Natural Fit for Data Science

What do you get when you combine the #1 code editor with the #1 programming language for data science?

You get over 60 million installs of the Python extension for Visual Studio Code, for one thing.

This is by far the most downloads of any tool on the VS Code Marketplace, which boasts two companion extensions ranking second and third: Jupyter (40.8 million) and Pylance (33.5 million). The main Python tool was downloaded almost 27 million times more than the most popular non-Python extension (C/C++, 33.3 million). Additionally, fifth place goes to another Python-related tool, Jupyter Keymap, with 23.4 million installs.

So to sum it all up, Python-related VS Code offerings account for four of the top five tools and have been installed a huge 157.8 million times!

It’s no wonder, then, that a presenter at the EuroPython show in Dublin tomorrow shares “why VS Code is now the #1 tool for Python data scientists according to the 2021 Python Software Foundation Developer Survey, and how you can leverage VS Code to take your data science productivity to the next level” in a presentation titled “Python & Visual Studio Code – Revolutionizing the Way You Do Data Science.”

The session summary states, “Visual Studio Code, GitHub, Codespaces, and Azure Machine Learning have invested heavily in tools and platforms to make life easier for Python data scientists.”

Indeed, the cited Python developer survey conducted last fall shows that VS Code is the most popular core IDE/editor in the Python camp, even ranking above the Python-specific PyCharm IDE of JetBrains (which conducted the survey of over 23,000 Python developers in conjunction with the Python Software Foundation).

IDE/Main Editor
[Click on image for larger view.] IDE/Main Editor (source: JetBrains/Python Software Foundation).

“The combined share of PyCharm Community and Professional editions is 31%, which is close to last year’s result. VS Code increased by 6 percentage points compared to last year,” the report says. investigation.

“Interestingly, PyCharm and VS Code are equally popular among web developers (39%), while data scientists prefer VS Code 9% more as their primary IDE.”

Data Science vs Web Development
[Click on image for larger view.] Data Science vs Web Development (source: JetBrains/Python Software Foundation).

Also interestingly, VS Code’s rise to #1 in the Python developer survey came fairly recently. In the 2018 survey, for example, it garnered only 16% of respondents’ votes, sandwiched in second place between PyCharm Professional Edition #1 and PyCharm Community Edition #3. .

Top Editors and IDEs Reported by Data Science and Web Developers
[Click on image for larger view.] Top Publishers and IDEs Reported by Data Science and Web Developers in the 2018 Report (source: JetBrains/Python Software Foundation).

This rise shouldn’t be too surprising, though, because years ago Microsoft went all out on the Python stakes, even hiring a software engineer. Don Jayamanne, who created this super popular Python extension for VS Code mentioned above. He then issued a siren call for more Python developers.

After that, Microsoft raised the table stakes even further, in 2020 hiring the creator of Python itself, Guido van Rossum. Microsoft recently reported that van Rossum and the company’s CPython performance team improved the core language runtime, which will make Python 3.1 10-60% faster than Python 3.10, depending on workload.

Hired to improve Python
[Click on image for larger view.] Hired to improve Python (source: Twitter).

The result of all this?

“Working with Python in Visual Studio Code, using the Microsoft Python extension, is easy, fun, and productive.”

This is according to Microsoft’s official “Python in Visual Studio Code” guidelines, which go on to say, “The extension makes VS Code a great Python editor and works on any operating system with a variety of It leverages all of VS Code’s ability to provide auto-completion and IntelliSense, linting, debugging, and unit testing, as well as the ability to easily switch between Python environments, including virtual and conda environments.

A Google Trends report illustrates the rise of VS Code in general, which began to spin off competitors PyCharm, IntelliJ IDEA, Sublime Text, and Notepad++ just at the time of this 2018 Python survey report. below makes it clear, interest in these other IDEs/editors (even the Python-specific PyCharm) has remained fairly constant over the past five years, while interest in VS Code has steadily increased and continues to drift away .

VS Code Google Trends
[Click on image for larger view.] VS Code Google Trends (source: Google).

VS Code was also named the #1 code editor in the Open Source Index last year. Also last year, WakaTime, which tracks time for programmers, released data for 2020 showing that VS Code was by far the best editor/IDE used by its coders. A Rust survey from 2020, meanwhile, again reported that VS Code was the #1 publisher among Rust developers. And, of course, VS Code has been #1 in Stack Overflow’s huge annual developer survey for years now.

The best IDEs in 2022
[Click on image for larger view.] The best IDEs in 2022 (source: stack overflow).

And all of these rankings listed above are general in nature, unrelated to the main use case of VS Code and Python, data science, where the editor is even more popular.


“Two features that make it extremely attractive in my opinion, which drive my definite preference over other code editors, are the extremely smart support for code completion and seamless switching between Notebook and Python files” , said developer Jishnu Bhattacharya in an article last year titled “Visual Studio Code for Data Science! The More I Use, the More I Love”

“It has helped me tremendously in improving my productivity. Believe me, you will have a similar experience to mine if you start using it,” said Bhattacharya, who listed those features he found appealing:

  • Python Module File (.py file), Jupyter Notebook and Terminal on the same window.

  • Intuitive interface
  • Superior IntelliSense
  • Extensive support for interactive coding
  • Feature-rich extension packages
  • Version control integration with Git/GitHub.
  • Customizing user and project level settings

Microsoft, of course, plays the data science angle in its Data Science in Visual Studio Code documentation, which also emphasizes the interactivity mentioned above by Bhattacharya: “You can do all your science work data in VS Code. Use Jupyter Notebooks and the Interactive Window to start analyzing and visualizing your data in minutes! Enhance your Python coding experience with IntelliSense support and create, train, and deploy data models. machine learning in the cloud or at the edge with the Azure Machine Learning service.”

André Ferreira is another developer with an affinity for “VS Code for data science” thanks to its many related extensions. His own TL; DR for this April article says, “VS Code can be pretty awesome for data science, especially if you pick the best extensions; In this article, I share some of my favorite extensions and my setup. Interestingly, one such extension is GitHub Copilot, an “AI pair programmer”, speaking of data science.

Daniel Morales followed up the theme of extensions with his article from last year titled “Top 10 Python Extensions for Visual Studio Code”. After Microsoft’s core required Python extension mentioned above in #1, its list includes:

Readers interested in learning more about the special relationship between VS Code, Python, and Data Science can tune in to tomorrow’s EuroPython session mentioned above, presented by Jeffrey Mew, a Product Manager at Microsoft working on Python Data Science and AI tools in VS Code. “This talk will walk through several common Python data science scenarios, showcasing all the productive tools VS Code has to offer along the way,” the abstract reads. “As a preview, we’ll showcase a best-in-class Jupyter Notebooks experience with VS Code Notebooks, a revolutionary new data cleansing/preparation experience with Data Wrangler in VS Code, collaboration features with GitHub and Codespaces, Azure Machine Learning for deployment, and more!” Select on-demand viewings will be available a few hours after the live broadcast of the conference, which will take place from July 11-17.

Other sessions presented by Microsoft’s VS Code/Python development team during the dual in-person/remote conference include:

“Make sure you don’t miss them!” said Microsoft program manager Luciana Abud in a July 11 blog post on “Microsoft at EuroPython 2022.”

“We will also be at the Microsoft booth to talk about the hard work our teams have done to continue to support the Python community and to improve the Python developer experience on our products over the past year.”

That could be a lot of talking.

About the Author

David Ramel is an editor and writer for Converge360.

Comments are closed.