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