17 VS Code Tips That Will Change Your Data Science Workflow

Dave Ebbelaar · Beginner ·🛠️ AI Tools & Apps ·3y ago

Key Takeaways

This video demonstrates 17 tips for optimizing the data science workflow in Visual Studio Code, including using data science project templates, running Jupyter notebooks, and customizing the editor with extensions and keyboard shortcuts. Tools such as Visual Studio Code, Cookie Cutter data science, Jupyter, and Python are utilized throughout the tutorial.

Full Transcript

Visual Studio codes is an amazing IDE for data science but you have to tweak it a little in order to get the most out of it so let's fix this first step is to use data science project templates you can build your own or use something like Cookie Cutter data science which has a predefined structure while you can open projects by going to file open folders there's a much faster way to do this navigate to your project folder in the terminal then type in code followed by a DOT and hit enter this will open up the directory in Visual Studio code with all your folders if you are on Mac you first have to run the shell command in order to add the code extension to your path then the next thing you have to do is file save as a workspace and now your project is stored in official Studio code workspace file in your directory with the jupyter extension you can run jupyter notebooks right inside Visual Studio code just create a file with the IPI MV extension and visual studio code will interpret it as a notebook select your python environment in the top right corner and then proceed to copy code from stack Overflow as usual it wasn't me it was not me I think one of the most powerful features of vs code for data science is running python code in an interactive window to set this up you go to the settings and then search for send selection to interactive window make sure this box is checked which will on pressing shift enter send selected python code to an interactive Jupiter session now let's make your workflow even faster by using keyboard shortcuts so basically official Studio code has a keyboard shortcut for anything that you can think of now instead of clicking around with the mouse all day we of course want to give our colleagues the impression that we're actually good developers by just using the keyboard to navigate around our code for now there are only a handful of keyboard shortcuts that you have to remember in order to never touch the mouse again when navigating Fierce code and of course all of these can be customized using the keyboard shortcuts over here see what I did there not anymore we don't do that here close it boom this is how we do it you can use command plus numpad to navigate around the different editors that are open on the screen so command 1 for the editor over here on the left and then Command 2 for the editor over here on the right now Pro tip and this is not default I like to set the focus into primary sidebar on command 0 and in this way I can navigate to the Explorer with command 0. now an even better way to open up files is by hitting command P this will open up the file search and even list your most recently opened files this way you don't have to navigate through the Explorer but you can just select your file from here so predict model boom open it up okay so now you know your way around the application and also how to open files just using the keyboard Wow Let's now take a look at what we can do inside the editor to speed up the process of writing code one of the most important things to learn when writing code is how to select single characters words and whole lines knowing how to do this with the keyboard can really speed up your workflow so here are the basics shift plus right arrow to select single characters option shift plus right arrow to select words and command shift plus right arrow to select whole lines using these commands I can easily Run part of a line to preview the data then run the whole line to store it in a variable then preview just the variable to see if the transformation actually succeeded now if you're not allowed to use the mouse then navigating through a long file with just the arrow keys is pretty annoying luckily there are better ways and you have a few options here first of all you can go all the way down or all the way up to your file by pressing command followed by the down arrow for going down or command followed by the up arrow for going all the way up second if you want to go somewhere in the middle you can hit command G then specify the line number and then hit enter the last option and that is my preferred option is by navigating the symbols within your file and you can do this by hitting command command shift plus period and this will list all the symbols within your script so this will be the variables the classes and also the functions and you can navigate through them by using the arrow keys and then hitting enter so let's say I want to go to the categorical features select it boom here I am another cool feature of Visual Studio code is that you can move stuff around we can just hit option and then use the arrow keys to move it up and down or put it back into place now let's say you want to change this variable name byte data to something more descriptive like daily Bike Share data for example but now we have a problem because it's not only referenced here but throughout the entire file luckily you can probably guess there's a shortcut for that so the way this works is we select the variable name then we hit command option plus F then we type in a new variable name and then we either press enter to go through it one by one or press command plus enter to update everything as once boom done another very powerful feature of vs code is multi-line editing and you activate this by pressing Ctrl option and then using the down and the up arrows select your lines so let's look at an example over here I mean the relevant features let's go down select everything and then we can for example add the prefix then go all the way to the back and add a number or whatever another action that you often have to perform is commenting lines and now of course you can do that by putting in a hashtag in front of a line but there's also an easier way to do that and that is by being on a line and then pressing command plus forward slash to comment the whole line and you can even do this with whole blocks of code so for example we want to comment out this there is also a shortcut to open up your terminal and this is Control Plus backtick and this is convenient when you have to check your environment or install some dependencies with Pip or Kona for example oh yeah and you should also use Snippets which are basically little code templates that you can Define and then insert into your file so for example I have a snippet over here to insert a linear regression model I have a whole video on how to use Snippets so if you don't know what those are I would highly recommend checking it out because these can really speed up your workflow Okay so we've covered a lot in this video and buying now you should know your way around Visual Studio code with the keyboard this is so fast one that I want to show you is the command palette and you can open this up by pressing command shift plus b so command P was for opening files and command shift p will open up the command palette and from here you can basically access anything that is available within Visual Studio code so if you're missing something or you're looking for something have a look over here and just type in what you're searching for and then my final tip for vs code is to explore the official themes that you can change to really alter the look and feel to your liking so you can install these from the extensions over here and I for example really like the atom1 dark team that you're currently looking at combined with the fluid icons that change the look and feel of these icons in the menu bars and then also this material icon team over here that basically changes the icons in your Explorer so these are the settings that I use but there are Endless Options here so explore them and try to find something that you like because after all you should really enjoy working with the tools that you use every day and changing up the appearance and setting up custom keyboard shortcuts and memorizing them can really make the process of writing python code for data science with Visual Studio code more enjoyable that's it for this video now please don't forget to leave a like and also please let me know down in the comments what your favorite tip for fias code is now if you want to learn more about working with data then subscribe to the channel and also check out some of the other videos that will pop up on the screen right now [Music]

Original Description

Want to get started with freelancing? Let me help: https://www.datalumina.com/data-freelancer Need help with a project? Work with me: https://www.datalumina.com/solutions In this video, I will share 17 tips for VS Code that will speed up your data science workflow drastically. 🕑 Timestamps 00:00 Introduction 00:07 Project templates 00:14 Open a folder from the terminal 00:41 Run Jupyter notebooks 00:59 Send Python to interactive window 01:16 Learn keyboard shortcuts 01:51 Window navigation 02:10 Search and open files 02:35 Select and edit code 03:08 Navigating to lines 03:48 Move lines around 03:56 Renaming things 04:24 Edit multiple lines 04:46 Comment lines 05:05 Open the terminal 05:14 Use code snippets 05:38 Using the command pallete 05:57 Explore visual themes 06:44 Conclusion ⬇️ Download Visual Studio Code https://code.visualstudio.com/ 📄 Keyboard Shortcuts Mac — https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf Windows — https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf 🍪 Cookie Cutter Data Science https://drivendata.github.io/cookiecutter-data-science/ 💬 Let's Connect Instagram — https://instagram.com/daveebbelaar LinkedIn — https://linkedin.com/in/daveebbelaar Twitter — https://twitter.com/daveebbelaar #datascience #machinelearning #python #vscode
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Dave Ebbelaar · Dave Ebbelaar · 17 of 60

1 How to Install Homebrew on Mac (Getting Started)
How to Install Homebrew on Mac (Getting Started)
Dave Ebbelaar
2 How to Install Python on Mac (Homebrew)
How to Install Python on Mac (Homebrew)
Dave Ebbelaar
3 How to Install Anaconda on Mac (Getting Started)
How to Install Anaconda on Mac (Getting Started)
Dave Ebbelaar
4 How to Set up VS Code for Data Science & AI
How to Set up VS Code for Data Science & AI
Dave Ebbelaar
5 How to Use Git in VS Code for Data Science
How to Use Git in VS Code for Data Science
Dave Ebbelaar
6 Data Science Desk Setup to Maximize Productivity
Data Science Desk Setup to Maximize Productivity
Dave Ebbelaar
7 THIS Is How I Write Clean Data Science Code EVERY TIME
THIS Is How I Write Clean Data Science Code EVERY TIME
Dave Ebbelaar
8 Data Science Tutorial - Project Structure
Data Science Tutorial - Project Structure
Dave Ebbelaar
9 Changing rcParams for Better Data Science Plots | Matplotlib Tutorial
Changing rcParams for Better Data Science Plots | Matplotlib Tutorial
Dave Ebbelaar
10 How to Read Excel Files with Python (Pandas Tutorial)
How to Read Excel Files with Python (Pandas Tutorial)
Dave Ebbelaar
11 My Data Science Journey (Zero to Freelance)
My Data Science Journey (Zero to Freelance)
Dave Ebbelaar
12 How I Automate Data Visualization in Python
How I Automate Data Visualization in Python
Dave Ebbelaar
13 16 Apps I Use Daily as a Data Scientist
16 Apps I Use Daily as a Data Scientist
Dave Ebbelaar
14 How to Manage Conda Environments for Data Science
How to Manage Conda Environments for Data Science
Dave Ebbelaar
15 How to Export Machine Learning Models in Python
How to Export Machine Learning Models in Python
Dave Ebbelaar
16 VS Code Speed Hack for Data Science
VS Code Speed Hack for Data Science
Dave Ebbelaar
17 VS Code Tips That Will Change Your Data Science Workflow
17 VS Code Tips That Will Change Your Data Science Workflow
Dave Ebbelaar
18 How to Predict the Future with Python (Forecasting Tutorial)
How to Predict the Future with Python (Forecasting Tutorial)
Dave Ebbelaar
19 How to Use Python Environment Variables
How to Use Python Environment Variables
Dave Ebbelaar
20 7 Data Science Tips for Beginners in 2023
7 Data Science Tips for Beginners in 2023
Dave Ebbelaar
21 How to Effectively Use the Data Science Lifecycle
How to Effectively Use the Data Science Lifecycle
Dave Ebbelaar
22 Full Machine Learning Project — Coding a Fitness Tracker with Python (Part 1)
Full Machine Learning Project — Coding a Fitness Tracker with Python (Part 1)
Dave Ebbelaar
23 Full Machine Learning Project — Processing Raw Data (Part 2)
Full Machine Learning Project — Processing Raw Data (Part 2)
Dave Ebbelaar
24 Full Machine Learning Project — Data Visualization with Matplotlib (Part 3)
Full Machine Learning Project — Data Visualization with Matplotlib (Part 3)
Dave Ebbelaar
25 This Will Change Data Science as We Know It (ChatGPT)
This Will Change Data Science as We Know It (ChatGPT)
Dave Ebbelaar
26 Full Machine Learning Project — Detecting Outliers in Sensor Data (Part 4)
Full Machine Learning Project — Detecting Outliers in Sensor Data (Part 4)
Dave Ebbelaar
27 Full Machine Learning Project — Low-pass Filter & Principal Component Analysis (Part 5a)
Full Machine Learning Project — Low-pass Filter & Principal Component Analysis (Part 5a)
Dave Ebbelaar
28 Full Machine Learning Project — Fourier Transformation & Clustering (Part 5b)
Full Machine Learning Project — Fourier Transformation & Clustering (Part 5b)
Dave Ebbelaar
29 Full Machine Learning Project — Predictive Modelling (Part 6)
Full Machine Learning Project — Predictive Modelling (Part 6)
Dave Ebbelaar
30 Automate Machine Learning with ChatGPT
Automate Machine Learning with ChatGPT
Dave Ebbelaar
31 Scraping Web Datasets for Data Science Projects
Scraping Web Datasets for Data Science Projects
Dave Ebbelaar
32 Full Machine Learning Project — Counting Repetitions (Part 7)
Full Machine Learning Project — Counting Repetitions (Part 7)
Dave Ebbelaar
33 How to Use GitHub Copilot for Data Science (Python + VS Code)
How to Use GitHub Copilot for Data Science (Python + VS Code)
Dave Ebbelaar
34 Every Beginner Data Scientist Should Understand This
Every Beginner Data Scientist Should Understand This
Dave Ebbelaar
35 Revealing My New AI-Powered Data Science Workflow
Revealing My New AI-Powered Data Science Workflow
Dave Ebbelaar
36 Auto-GPT Tutorial - Create Your Personal AI Assistant 🦾
Auto-GPT Tutorial - Create Your Personal AI Assistant 🦾
Dave Ebbelaar
37 Build Your Own Auto-GPT Apps with LangChain (Python Tutorial)
Build Your Own Auto-GPT Apps with LangChain (Python Tutorial)
Dave Ebbelaar
38 Building Slack AI Assistants with Python & LangChain
Building Slack AI Assistants with Python & LangChain
Dave Ebbelaar
39 ChatGPT Code Interpreter - Goodbye Data Analysts?
ChatGPT Code Interpreter - Goodbye Data Analysts?
Dave Ebbelaar
40 How to Deploy AI Apps to the Cloud with Flask & Azure
How to Deploy AI Apps to the Cloud with Flask & Azure
Dave Ebbelaar
41 How to Build an AI Document Chatbot in 10 Minutes
How to Build an AI Document Chatbot in 10 Minutes
Dave Ebbelaar
42 Is Falcon LLM the OpenAI Alternative? An Experimental Setup with LangChain
Is Falcon LLM the OpenAI Alternative? An Experimental Setup with LangChain
Dave Ebbelaar
43 GPT Engineer... Generate an entire codebase with one prompt
GPT Engineer... Generate an entire codebase with one prompt
Dave Ebbelaar
44 Pandas DataFrame Agent... the future of data analysis?
Pandas DataFrame Agent... the future of data analysis?
Dave Ebbelaar
45 OpenAI Function Calling - Full Beginner Tutorial
OpenAI Function Calling - Full Beginner Tutorial
Dave Ebbelaar
46 How to use ChatGPT's new “Code Interpreter” feature
How to use ChatGPT's new “Code Interpreter” feature
Dave Ebbelaar
47 LangChain just launched their new "LangSmith" platform
LangChain just launched their new "LangSmith" platform
Dave Ebbelaar
48 How I'd Learn AI (if I could start over)
How I'd Learn AI (if I could start over)
Dave Ebbelaar
49 I Used AI To Scrape The Web & Write PDF Reports
I Used AI To Scrape The Web & Write PDF Reports
Dave Ebbelaar
50 LangSmith Tutorial - LLM Evaluation for Beginners
LangSmith Tutorial - LLM Evaluation for Beginners
Dave Ebbelaar
51 7 Lessons for New AI Engineers - Beginner’s Guide
7 Lessons for New AI Engineers - Beginner’s Guide
Dave Ebbelaar
52 The Rise of the "New-Age" Machine Learning Engineer
The Rise of the "New-Age" Machine Learning Engineer
Dave Ebbelaar
53 OpenAI Assistants Tutorial for Beginners
OpenAI Assistants Tutorial for Beginners
Dave Ebbelaar
54 How To Connect OpenAI To WhatsApp (Python Tutorial)
How To Connect OpenAI To WhatsApp (Python Tutorial)
Dave Ebbelaar
55 How to Build Chatbot Interfaces with Python
How to Build Chatbot Interfaces with Python
Dave Ebbelaar
56 PostgreSQL as VectorDB - Beginner Tutorial
PostgreSQL as VectorDB - Beginner Tutorial
Dave Ebbelaar
57 My MacBook Setup (as a coder & business owner)
My MacBook Setup (as a coder & business owner)
Dave Ebbelaar
58 Easiest Way to Connect AI Chatbots to WhatsApp
Easiest Way to Connect AI Chatbots to WhatsApp
Dave Ebbelaar
59 ClickUp Tutorial - What Is ClickUp Brain? 🧠
ClickUp Tutorial - What Is ClickUp Brain? 🧠
Dave Ebbelaar
60 My Development Workflow for Data & AI Projects
My Development Workflow for Data & AI Projects
Dave Ebbelaar

This video teaches 17 tips for optimizing the data science workflow in Visual Studio Code, covering topics such as project templates, Jupyter notebooks, and customization. By following these tips, viewers can improve their productivity and efficiency in VS Code. The video is geared towards beginners in data science and VS Code.

Key Takeaways
  1. Use data science project templates like Cookie Cutter data science
  2. Open projects in Visual Studio Code by navigating to the project folder in the terminal and typing 'code .'
  3. Save a project as a workspace in Visual Studio Code
  4. Run Jupyter notebooks in Visual Studio Code with the Jupyter extension
  5. Set up an interactive window to run Python code in Visual Studio Code
  6. Navigate to the end of a file using command + down arrow
  7. Navigate to the top of a file using command + up arrow
  8. Navigate to a specific line number using command + G
  9. List symbols in a file and navigate through them using command + shift + period
  10. Move text up and down using option + arrow keys
💡 Customizing Visual Studio Code with extensions and keyboard shortcuts can significantly improve productivity and efficiency in data science workflows

Related AI Lessons

Chapters (19)

Introduction
0:07 Project templates
0:14 Open a folder from the terminal
0:41 Run Jupyter notebooks
0:59 Send Python to interactive window
1:16 Learn keyboard shortcuts
1:51 Window navigation
2:10 Search and open files
2:35 Select and edit code
3:08 Navigating to lines
3:48 Move lines around
3:56 Renaming things
4:24 Edit multiple lines
4:46 Comment lines
5:05 Open the terminal
5:14 Use code snippets
5:38 Using the command pallete
5:57 Explore visual themes
6:44 Conclusion
Up next
How to Open HPL Files (HP-GL Plotter)
File Extension Geeks
Watch →