aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • Programming
  • Technology

Visual Studio Code for Python and Data Science? Top 3 Plugins You Must Have

  • root
  • October 25, 2021
  • 4 minute read

Is it the best code editor for Python and Data Science?

Are you struggling to find an optimal code editor for Python programming and data science? You’re not alone. There’s a ton of options to choose from — both free and paid — and today I’ll show you my favorite free one.


Partner with aster.cloud
for your next big idea.
Let us know here.



From our partners:

CITI.IO :: Business. Institutions. Society. Global Political Economy.
CYBERPOGO.COM :: For the Arts, Sciences, and Technology.
DADAHACKS.COM :: Parenting For The Rest Of Us.
ZEDISTA.COM :: Entertainment. Sports. Culture. Escape.
TAKUMAKU.COM :: For The Hearth And Home.
ASTER.CLOUD :: From The Cloud And Beyond.
LIWAIWAI.COM :: Intelligence, Inside and Outside.
GLOBALCLOUDPLATFORMS.COM :: For The World's Computing Needs.
FIREGULAMAN.COM :: For The Fire In The Belly Of The Coder.
ASTERCASTER.COM :: Supra Astra. Beyond The Stars.
BARTDAY.COM :: Prosperity For Everyone.

It’s Visual Studio Code — a completely free code editor from Microsoft. It’s by far the most flexible and feature-rich code editor I found. It even has more features than PyCharm Community, which is supposed to be a professional IDE. And don’t even get me started on Jupyter — it’s probably the best way to write notebooks, but notebooks alone aren’t enough for data professionals.

Today you’ll see my go-to approach for setting up VSCode for Python programming and data science. We’ll start with the installation and go through the plugins from there.

Don’t feel like reading? Watch my video instead:

 

Download and install Visual Studio Code

Head over to code.visualstudio.com to download VSCode. The webpage should detect your OS automatically, so you only need to hit the big blue download button:

Image 1 — Visual Studio Code home page (image by author)

On Mac, it will download a ZIP file which you can extract and drag the app to the Applications folder. On Windows, I assume you need to open the .EXE file and click on Next a couple of times, and for Linux, it’s probably either a Terminal command or a DEB file.

Here’s what you should see once you launch it:

Image 2 — Visual Studio Code (image by author)

You can create a Python file by opening any folder on your machine, right-clicking the left sidebar and selecting New file. I’ve created a folder on Desktop and a main.py file in it:

Read More  IBM and Oracle Expand Partnership to Advance Agentic AI and Hybrid Cloud
Image 3 — Creating a Python script in VSCode (image by author)

By default, you won’t have the best debugging options, nor you’ll have IntelliSense. You also won’t be able to select a virtual environment. Fixing this is quick and easy. You only need to install a plugin. But let’s address something more urgent first.

Download a theme (optional)

The first thing I like to do in VSCode is to change the theme. It has nothing to do with Python and data science, so you can either skip this section or consider it as a bonus point.

The default theme is just too Microsofty for me. To change it, you can click on the Extension tab and search for themes. I particularly like the One Dark Pro theme, which is free, even though it says Pro:

Image 4 — One Dark Pro theme (image by author)

Click on the theme and hit the Install button. The default skin is a bit too light for my liking. On Mac, you can press CMD+K CMD+T to open the theme dropdown. My favorite is One Dark Pro Darker:

Image 5 — Using a custom theme (image by author)

Much nicer, isn’t it? Let’s address the extensions next.

Official Python extension

This one is a must-have if you want to work with Python. Go to the Extensions tab once again and search for Python. You should install the official extension from Microsoft:

Image 6 — Official Python extension (image by author)

You’ll now have a much easier time writing Python files. You can also choose a virtual environment now, which is something you’ll do daily. Click on the bottom left text that says Python 3.9.7 64 bit (at least on my machine) and select any environment you want:

Image 7 — Choosing a virtual environment (image by author)

Do you know what the best part is? You can immediately start working with Jupyter Notebooks! Create a .ipynb file to verify — it might prompt you to install some additional dependencies, so just agree to everything.

Read More  Getting Started With Google Cloud Logging Python V3.0.0

Once installed, you can enter Python code to a cell to verify everything works:

Image 8 — Testing Jupyter Notebooks (image by author)

And that’s it — you now have the basics installed, so you can work with Python either through scripts or through notebooks. Let’s add some additional functionality next.

Python docstring generator

One essential tip for writing good Python code is documentation. VSCode can help you with that. All you need to do is to install the Python Docstring Generator extension.

Image 9 — Python Docstring Generator extension (image by author)

Let’s see how it works. You’ll write a dummy Python function that sums up two integers:

def add(a: int, b: int) -> int:
    return a + b

Write the function inside main.py:

Image 10 — Dummy Python function (image by author)

You can now add a docstring by writing three double quotes below the function declaration and selecting the Generate Docstring option:

Image 11 — Docstring generator (image by author)

It will immediately write the boilerplate for you:

Image 12 — Docstring boilerplate (image by author)

All you’ll have to now is to edit the description and the role each parameter has:

Image 13 — Editing the docstring (image by author)

That’s much easier than writing everything from scratch. Maybe you don’t see the benefit because we have only one function, but imagine you had multiple Python modules, each having dozens of functions — then this extension is a huge time saver.

Python linter

And finally, I want to discuss linting. You can enable linting in VSCode to automatically tell you if you’re not following Python conventions. It will tell you if you have unused imports, variables, or if there’s anything to improve in your code.

To start, open up the Command Palette (Settings — Command Palette… or press SHIFT + CMD + P) and type in Linter. Choose the Select Linter option:

Read More  Securing Apps For Googlers Using Anthos Service Mesh
Image 14 — Selecting Python linter (image by author)

PyLint is the most popular one, so just click on it:

Image 15 — Linter options (image by author)

It will ask you to install PyLint if it’s not installed already. You’ll have to repeat the process for every virtual environment, so keep that in mind:

Image 16 — Installing PyLint (image by author)

Let’s now delete the add() function and explore what PyLint has to offer. You’ll import json and random modules and print a random integer between 1 and 100:

import json 
import random

print(random.randint(1, 100))

Here’s how it should look like:

Image 17 — Warning messages (1) (image by author)

You’ll see warning messages as soon as you save the file. The print statement complains because there’s no new line after it, but that’s a quick fix — just hit Enter at the end of the line.

The top import statement is underlined because we don’t have a file-level docstring on the top, so let’s write one quickly:

Image 18 — Warning messages (2) (image by author)

The warning won’t go away if you save the file. It now complains that you’ve imported json but aren’t using it in the file:

Image 19 — Warning messages (3) (image by author)

The message will go away once you delete the unused import.

To summarize, linters can help you write better Python code and make sure you’re following all the conventions. Your code will still run if the linter gives you warning messages, but it’s annoying to look at them, so you’ll likely address them as they come.

And that’s it for today. My Python and data science setup in VSCode is somewhat simplistic, but it gets the job done.

What are your favorite VSCode extensions for Python and data science? Please let me know in the comment section below.

This article was republished from towardsdatascience.com


For enquiries, product placements, sponsorships, and collaborations, connect with us at [email protected]. We'd love to hear from you!

Our humans need coffee too! Your support is highly appreciated, thank you!

root

Related Topics
  • Apple Developer
  • Data Science
  • OS
  • Programming Language
  • Python
  • Visual Studio
  • VSCode
You May Also Like
View Post
  • Technology

IBM Study: One in Four Malicious Breaches are AI-Enabled, Costing Companies $6 Million on Average

  • July 29, 2026
View Post
  • Technology

3 Questions: Neural transparency and the future of AI design

  • July 17, 2026
View Post
  • Technology

IBM and Red Hat Expand Lightwell with New Offerings to Build the Trust Infrastructure for AI-Era Open Source

  • July 8, 2026
View Post
  • Technology

The AI investment surge hasn’t produced the expected results yet. That could change in 2026

  • June 26, 2026
zedreviews-valerion
View Post
  • Gears
  • Technology

Father’s Day Outdoors – Build Dad the Ultimate Backyard Watch Party

  • June 20, 2026
zedreviews-fathers-day-50830
View Post
  • Gears
  • Technology
  • Tools

Father’s Day Outdoors, Round Two – Gear for the Action, the Tailgate, and Beating the Heat

  • June 20, 2026
zedreviews-fathers-day-2147684744
View Post
  • Gears
  • Technology
  • Tools

The Ultimate Father’s Day Gift Guide – Home Entertainment Upgrades Dad Actually Wants

  • June 20, 2026
zedreviews-fathers-day-21306
View Post
  • Gears
  • Technology

A Father’s Day Gift Guide for Every Dad – Timepieces and Travel Gear

  • June 20, 2026

Stay Connected!
LATEST
  • 1
    IBM Study: One in Four Malicious Breaches are AI-Enabled, Costing Companies $6 Million on Average
    • July 29, 2026
  • 2
    Accelerating the frontiers of scientific discovery: Google’s $40M commitment to the Genesis Mission
    • July 26, 2026
  • 3
    3 Questions: Neural transparency and the future of AI design
    • July 17, 2026
  • 4
    Intel Invests €5 Billion to Expand Manufacturing in Europe
    • July 13, 2026
  • 5
    IBM and Red Hat Expand Lightwell with New Offerings to Build the Trust Infrastructure for AI-Era Open Source
    • July 8, 2026
  • 6
    When I Was Young
    • July 4, 2026
  • 7
    The Fastest AI Fried Chicken In The World
    • June 29, 2026
  • 8
    Zed Approves | How to Stay Cool in Extreme Heat
    • June 29, 2026
  • 9
    The AI investment surge hasn’t produced the expected results yet. That could change in 2026
    • June 26, 2026
  • 10
    Zed Approves | It’s Prime Day 2026! Time to Upgrade Your World Cup Viewing Setup and Beat the Heat
    • June 25, 2026
about
Hello World!

We are aster.cloud. We’re created by programmers for programmers.

Our site aims to provide guides, programming tips, reviews, and interesting materials for tech people and those who want to learn in general.

We would like to hear from you.

If you have any feedback, enquiries, or sponsorship request, kindly reach out to us at:

[email protected]
Most Popular
  • 1
    Zed Approves | The Best Prime Day PC Deals: Top Gaming Rigs, Workstations, and Everyday Laptops
    • June 24, 2026
  • neon-cart 2
    Zed Approves: How to Gear Up for GTA 6 This Amazon Prime Day (2026 Quick Guide)
    • June 22, 2026
  • zedreviews-valerion 3
    Father’s Day Outdoors – Build Dad the Ultimate Backyard Watch Party
    • June 20, 2026
  • zedreviews-fathers-day-50830 4
    Father’s Day Outdoors, Round Two – Gear for the Action, the Tailgate, and Beating the Heat
    • June 20, 2026
  • zedreviews-fathers-day-2147684744 5
    The Ultimate Father’s Day Gift Guide – Home Entertainment Upgrades Dad Actually Wants
    • June 20, 2026
  • /
  • Technology
  • Tools
  • About
  • Contact Us

Input your search keywords and press Enter.