Как установить pandas vs code

от admin

How do I install pandas into visual studios code?

I want to read an excel csv file, and after researching, I realized I need to import pandas as pd . Is there a way to install it into the visual studio code? I have tried typing import pandas as pd , but it shows a red line. I’m still new to python.

7 Answers 7

As pandas is a Python library, you can install it using pip — the Python ‘s package management system. If you are using Python 2 >=2.7.9 or Python 3 >=3.4, pip is already installed with your Python . Ensure that Python has been added to PATH

Then, to install pandas , just simply do:

I think the above answers are very well put already. just to add to that.

Windows:

2.type python -m pip install pandas

3.restart your visual studio code

Linux or macOS:

2.type pip install pandas

3.restart your visual studio code

you can install using pip
pip install pandas

George Imerlishvili's user avatar

For anyone else in a similar situation, I’d recommend following along with this VS Code official tutorial.

It guides you to use Conda instead of Pip, and setup a Python environment, along with installing various packages like Pandas, Jupyter, etc.

For example, after installing the Python extension for VSCode and Miniconda or Anaconda:

I also had the same question. As a newbie, I did not understand the answer. Perhaps these notes will help others in the same boat.

You need to type this into command prompt (not visual studio or python): pip install pandas

Before you do that, you must "Ensure that Python has been added to PATH". This did not make sense to me, but there are pages on this if you Google.

Also useful to know: CMD and Terminal = Command Prompt (please correct me if that’s not true).

Hopefully this helps others. Thanks

In terminal on vscode, check and make sure python is installed:

Then you can install libraries with:

py -m pip install packagename

This was a simple solution I came up with since the others weren’t working on my system. Hopefully this helps!

You need to start off by installing Anaconda in order to create an environment for Pandas; you can manage this environment with Anaconda. Go to your terminal then run conda create -n myenv python=3.9 pandas jupyter seaborn scikit-learn keras tensorflow . It will create environments for all of the libraries mentioned above. PS : this is an old post, please check python’s latest version

After that click on your Kernel1 (top right) and chose the environment that is associated with Anaconda

    The Overflow Blog
Linked
Related
Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.3.11.43304

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Installing a Python Library in Visual Studio Code — Windows

In this quick blogpost, I will share the steps that you can follow in order to install a Python library using pip through either the Terminal or a Jupyter Notebook in Visual Studio Code (VSCode) on a Windows computer.

Pre-requisites

In order to complete the steps of this blogpost, you need to install the following in your windows computer:

  • Visual Studio Code : you can find the steps to install it here.
  • Python Extension for Visual Studio Code : you can find the steps to install it here.
  • Python Interpreter : you can find the steps to install it here.

Installing a Python Library Using the Terminal in VSCode

1) Accessing Visual Studio Code Terminal

  • Open VSCode application

  • Go to the Terminal menu and select New Terminal .

  • A new terminal (PowerShell based) window is opened.

2) Importing a Python Library

  • Run the following command to validate that pip is installed in your computer.

  • Let us say that you want to install Pandas Python library.
  • Run the following command

  • Pandas library is now ready to be imported by any python application. You can repeat this process for any Python library.

Installing a Python Library Using a Jupyter Notebook in VSCode

1) Creating a Jupyter Notebook in VSCode

  • Create a Jupyter Notebook following the steps of My First Jupyter Notebook on Visual Studio Code (Python kernel)

2) Importing a Python Library

  • Run the following command to validate that pip is installed in your computer.

  • Let us say that you want to install Pandas Python library.
  • Run the following command.

How to Set up Python and Visual Studio Code IDE for Data Science

Setting up Python and running it smoothly on your PC is essential for data analytics or computational work. With advancements in open-source package managers, it has become simple and straightforward. In this tutorial, we will go through the whole process from downloading to installing Python and setting a custom environment for personal projects.

The entire process involved downloading Miniconda (python library manager) and Visual Studio Code, installing them, and creating an environment for managing and handling project libraries.

Why Miniconda?

Because it is small in size, easy to download, and only contains required libraries and dependencies which require minimum installation time.

Why Visual Studio Code?

Because VS Code is one of the best integrated development environment (IDE) with awesome look and up-to-date functionalities used by millions of developers worldwide. It is maintained by Microsoft and absolutely free to use.

Article Outline

  1. Downloading and installing Miniconda
  2. Downloading and installing Visual Studio Code
  3. Setting up a new environment
  4. Check for code execution

Let’s start with the set-up process.

1. Downloading and Installing Miniconda

Step 1.1: The very first step is to download the Miniconda. Miniconda is the smaller installer version of the Conda. It includes only conda, Python, the packages they depend on, and a small number of other useful packages, including pip, zlib and a few others.

Use the following link to download the Miniconda. Download the version that includes Python 3.8 or above based on your operating system and its configuration (32 bit or 64 bit).

Step 1.2: Once the downloading is complete, then start the installation process. It will first show the welcome page.

Click “Next >” button.

Step 1.3: The next step is to accept the license agreement by clicking “I Agree”.

Step 1.4: Once you accept the license agreement, then you need to select the installation type. For personal use, select “Just Me” and click “Next >

Step 1.5: In the next step, select the directory where you would like to install Miniconda. If your default location has enough memory, then proceed with that directory.

Step 1.6: Next we need to set the following:

  • Setting path variable: tick the add Miniconda to my PATH environment variable.
  • Next tick the “Register Miniconda3 as my default Python 3.9. It will set the Anaconda as the primary Python 3.9 on the system. We can change it later during customized Miniconda environment setup.

Step 1.7: Click the install button to start the Miniconda installation in your PC.

Step 1.8: Once the installation is done, it will show the “Installation Complete” on top of the installation page.

Click “Next >” to finish the installation process.

To finish the process, uncheck the following boxes (as they are not that much important) and click “finish”.

2. Downloading and Installing VS Code

Once the Miniconda installation is complete, you can proceed with the Visual Studio Code installation.

Step 2.1: First, visit the following website to download the desired version of the VS Code.

Here, in this blog, I will go with Windows 64 bit version. You can proceed with Windows/Linux/Mac, whichever your preferred operating system. The process is almost similar.

Step 2.2: Once you start the installation, it will first ask you to accept the license agreement.

After accepting the license agreement, click “Next >” to proceed to the next page.

Step 2.3: In the next step, select the directory where you would like to install VS Code. If your default location has enough memory, then proceed with that directory.

Step 2.4: In this page, it will inform you that it will create a shortcut in the Start Menu Folder.

Click “Next>” and proceed to the next page.

Step 2.5: Next tick the following boxes as illustrated in the image below.

Thereafter, proceed with “Next>”.

Step 2.6: In this page, it will inform us that the application is now ready to begin installation in your computer with all desired settings that we have selected initially.

Proceed with “install” to begin the installation process.

Here, is a screenshot of the installation process.

Step 2.7: Now we have reached the final page, which is showing that the installation process is complete. We can now click the finish button to launch VS Code IDE.

This is what VS Code home page looks like.

Step 2.8: To run the python in VS Code smoothly, we need to install the Python extension provided by Microsoft. It offers IntelliSense (Pylance), linting, debugging, code navigation, code formatting, refactoring, variable explorer, test explorer and more!

To install it:

  • First click the four dots menu on the left side called “Extensions”.
  • Then type Python in the search bar (it requires internet connection).
  • Look for the Python by Microsoft.
  • Click it and look on the right side for install button.
  • Click on the install button.

Here is a screenshot of the extension page after installation.

Step 2.9: Next, click on the “Explorer” located on the left side menu (top one).

  • Next press Ctrl + Shift + P, it will open the Command Palette. The command palette is the option menu from where any functionality of VS Code can be set or altered.
  • Next, type in the search “Select Interpreter”. Once it shows the option, click on it and wait for a few seconds.

After waiting for a few seconds, it will show all the available Python interpreters. Here in the below image it is showing the Python 3.9.7 as base interpreter. This is the default that was installed with the Miniconda, and we could utilize it to run Python codes.

But occasionally, we need to create a separate environment for running Python, especially for a group project. Here comes the part called Python environment.

3. New Environment Set-up

Now, you might be curious why we want a separate Python environment?

Because we need it for managing Python packages for different projects. Python environment allows us to avoid installing Python packages globally, which could break system tools or other projects.

Now let’s begin the environment set-up.

Step 3.1: First go to windows menu and look for “Anaconda Prompt (miniconda 3).

Click it to open it in a separate window.

Once you open it, it looks like the following, where

  • (base) indicates that we are now in base environment (under Miniconda)

Step 3.2: As we want to create a new environment to manage all our libraries.

Let’s create a new environment.

To create a new environment, we need to run the following code, where you have to enter your environment name in place of “yourenvname”. Our base environment was Python 3.9.7 (base). But let’s assume that we specially need the Python version 3.8 for our new environment. So, at the end of the comment, we will add the Python version “python=3.8”.

So say I would like to name my new virtual environment as “datascience” and want python 3.8 as my default python version. To execute and create a virtual environment with the above stated configurations, we need to run just the following code in the command prompt.

Once you press enter and execute the code, it will prompt you to install various default packages (dependencies) under the new environment.

  • Type “y” which means “yes” and press enter. Wait until the installation is done.

After the installation, you can check different environments available under Miniconda.

  • Type “conda env list”

It will print the existing environment names. You can see that there are two environments. The base and our newly created environment, datascience.

Step 3.3: Now we are ready with our new conda environment called “datascience”. Before we use this environment to run code in VS Code, we need to install some basic libraries/packages inside our “datascience” environment.

To install packages inside our datascience environment, we need to first activate it.

Just type “conda activate datascience” without any quote in the command prompt. Now you can observe that environment name datascience is inside the parenthesis (datascience) instead of base environment (base). It indicates that our new environment “datascience” is activated.

Step 3.4: As the datascience environment is now activated, we can install different packages inside this environment that we are going to utilize for data analysis.

To install any package (that are available under anaconda repositories/servers holding libraries), we need to run the following code, where replace the “library_name” with real library name.

First, we need to install the ipykernel library so that we could run the Jupyter notebook inside VS Code using the following command.

Similarly, we need to install pandas (for data wrangling), matplotlib, seaborn and plotly (for plotting/data visualization).

Here is a snapshot of pandas installation.

Note: While installing libraries, it may ask you to install additional dependencies (upon which the current library depends). If it shows different library names (which will be installed) and displays “y/n” then press ‘y” means “yes’ install all dependencies. Afterward, just wait until all dependencies are installed in the activated “datascience” envirobnment.

Step 3.5: Next open the VS Code and enter Ctrl + Shift + p to open the command palette. Type “Select Interpreter” and click on it and wait for a few seconds.

Now, it will show all the available interpreters. You can observe that it is showing Python 3.9.7 (base: conda) and our newly created environment Python 3.8.11 (datascience: conda).

  • Select the Python 3.8.11 (datascience: conda)as we are going to set it as the default environment for our current work or project.

Step 3.6: Next, we will create a new Jupyter Notebook so that we can test that our code runs in the newly created environment.

What is a Jupyter Notebook?

Jupyter notebook is a web like application which used by research scholars, data engineer, data analyst, machine learning scientist, scientific researchers or a general user who wants to do any sort of scientific computation, data processing or visualization related work.

  • To create a new Jupyter notebook (also known as IPython Notebook) just open the command palette (Ctrl + Shift + p) and type “New Jupyter Notebook” without any quotation, and click it to create a new notebook.

Here, the below snapshot shows a blank Jupyter Notebook with empty cell.

Step 3.7: First, we will check whether the datascience environment is working fine or not.

  • Type 1+1 in the cell and run by pressing the “triangular arrow” button on the left side of the cell. You can also run the cell by Ctrl + Enter. If it produces an answer of 2, then it is working well.
  • Next, let's check whether the libraries we properly installed under the datascience environment. First we need to create a new cell where we test the libraries. To generate a new cell, just press Ctrl +Shift + b where b indicates below. Now we will import the pandas library in the current Jupyter Notebook session. Type “import pandas as pd”without any quotation in the new cell, then run the cell. If it runs without producing any error, then our environment is working fine.

Now our environment is ready, and we can use it to run codes and perform data analysis.

Note: You can create unlimited environments based on your project requirements.

I hope you learned something new!

If you learned something new and liked this article, share it with your friends and colleagues. If you have any suggestions, drop a comment.

Setting up Windows Store Python with Pandas in VSCode

Post Header Image

My beloved Spyder IDE suddenly stopped working on me, and I needed to install Python + Pandas on a new computer anyway, so I decided to explore installing Python (and various packages I use with it such as Pandas) out of the Windows Store, executing code in VSCode as an IDE.

The Windows installation of Python is pretty stripped down, like that of Miniconda, and similarly doesn’t require admin rights to one’s computer.

Therefore, I’ll cover hand-installing a few simple packages as in my older tutorial.

Note: This tutorial is aimed at non-programmers who just want to edit a few CSV files with Python. If you’re a serious data scientist, learn the nuts and bolts of Anaconda at Real Python’s “Setting Up Python for Machine Learning on Windows”

Did you get Python up and running?

Yay! I’m thrilled I could help.

If you’d like, I’d love a Ko-Fi. (Chai for me!) ��

Installing Windows-Store Python & running a Python program

Install Python from the Windows store

Click the Windows icon in the bottom-left corner of your screen, and then without clicking anything else, type the word “ store .”

The Windows start menu should filter your list of available programs to suggest the Microsoft Store app. Click it.

Screenshot

In the upper right corner of the store window, click the text entry panel next to a magnifying glass and type the word “ python ” and press enter.

Available software to download should filter itself. Click the piece of Software named “Python #.#” but not “Python #.# (RC)” where “#.#” is some number. I suggest choosing the greatest non-RC number available to you (3.8 at the time of writing this tutorial, although as you can see in the screenshot, 3.7 is also available to me).

Screenshot

Verify the legitimacy of the software by checking that the Python Software Foundation is the publisher of the software, then click the big blue “Get” button.

Screenshot

The button will be replaced by a meter indicating your download and installation progress. Screenshot

When finished, you can close the Store app.

Click the Windows icon in the bottom-left corner of your screen – at the top of your start menu, you should see “Python #.#” and “IDLE (Python #.#)” software added. (Alternatively, they should be under “P” and “I,” respectively, in your start menu’s main list of programs.)

If you’d like, you can click one of them and try running print(‘Hello’) right from the Python command prompt windows they bring up, but personally, I don’t like interactive Python command lines. I usually need to write multiple-command script files and execute them.

Screenshot

Some tech details for nerds

Skip this little list if it doesn’t make any sense to you

  1. The Windows Store seems to install copies of the Python interpreter (a.k.a. the program python.exe ), which makes your computer understand code written in the Python programming language at both these two places – I’m not 100% sure which it’s really using, since using where python in the command line tells me one thing but various informational messages in VSCode tell me another:
    • C:\Users\YOUR_USERNAME\AppData\Local\Microsoft\WindowsApps\
    • C:\Users\YOUR_USERNAME\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.#.#_LONGWEIRDTEXT\
  2. The Windows Store seems to install PIP, which helps you install and upgrade Python “modules” (extensions to the programming language) , into the same 2 folders as pip.exe .
  3. The Windows Store installer seems to do a pretty good job of putting these two executables in your operating system’s PATH environment variable, so that when you simply open a Windows command line and type a command beginning with python such as python —version , or one beginning with pip such as pip —version , they run properly.

Hello World: running a Python program

Open up a nice text editor like Notepad++.

Create a new file. In it, type the following text, using the apostrophe key on your keyboard for the single quotes:

Do “File -> Save As.”

Pick a nice folder for your program (personally, I’m going to save mine under C:\example\ , but you might want to put it on your desktop) and save it there with a filename of “ hello.py ,” being sure to change the “Save as type” option to “Python file” or to “All Types (.).”

Once you’ve done that, open a “command-line prompt” by hitting the Windows key on your keyboard, typing “ cmd ,” and hitting “enter.”

At the prompt, type something along the following lines, only changing the file paths to be where yourpython.exe ” lives and where yourhello.py ” lives, and hit your enter key:

You should see “ Hello World ” right below your command.Go you! You just wrote a program in Python and executed it!

Setting up an IDE for pleasant programming

That wasn’t a particularly fun way to code, was it?

If you’ve practiced coding in an online “IDE” like Repl.it or CodeBunk, you know that coding can be as easy as clicking a big “run” button every time you type enough text that you wonder what it does.

To get the same experience, we need to install an “IDE” on our PC.

A popular one is Microsoft’s VSCode.

Install VSCode

Installing VSCode is a straightforward process of downloading the software from Microsoft’s web site and double-clicking the installer file, then following directions as prompted.

I don’t have screenshots because it was already installed on my computer. I have admin rights to the computer I was working on, so please let me know in the comments if this tutorial doesn’t work for you in a pure no-admin-rights context – I suspect I installed VSCode for the whole computer when I installed it.

Once you’ve installed VSCode, run it.

Python-ifying VSCode with a plugin

At the far left of VSCode, click the bottom icon that looks like a square joining 3 other squares to make a bigger square. This will bring you to the Extensions section of VSCode.

In the search box at the top of the left-hand control for Extensions, type “ python ” and click the official Python plugin published by Microsoft itself.

Click the green Install button.

Screenshot

When your extension finishes installing, it might let you know that there’s a way to change which Python interpreter VSCode uses to facilitate executing code written in the Python programming language.

Go ahead and click “Got it!” if so.

Screenshot

Just for fun, click “ Python #.#.# 64-bit ” in the bottom-left corner of VSCode.

Screenshot

VSCode’s command pallet will open toward the top center of VSCode and give you an option to choose which python.exe installation on your computer you’d like it to treat at the Python interpreter on your computer.

(Programmers sometimes keep multiple versions of Python installed on their computer all at once.)

Click anywhere outside this command pallet menu to get rid of it. I just wanted to show you around in case you were curious.

Screenshot

Using our IDE to program

Close VSCode and fire it up again. You might not see Python #.#.# 64-bit in the bottom-left corner of VSCode anymore.

That’s okay – you can bring it back by navigating through the top menu to File > Open File and opening the file you saved at, for example, c:\example\hello.py .

(Note: I closed out of the tip that popped up telling me I hadn’t yet installed a “linter.”)

Screenshot

You should see that hello.py contains the following code:

To run this code, click the green right-facing triangle (the “play button” / “run button”) toward the top right corner of VSCode.

If it gives you a drop-down menu, choose “Run Python File in Terminal.”

Screenshot

In the “Terminal” tab of a panel below your code, you should see the words:

It should appear between “command prompts” that say:

Screenshot

Now erase the entire contents of the file, and on line 1, type:

Then click the big green “run” button.

In the “Terminal” output below, do you see the following output text?

Congratulations – you’ve set up VSCode and you’re almost ready to write bigger programs!

In the top menu, click “File” -> “Save” because why not be proud of this working code? It’s good to get used to saving your work as soon as you like it.

Some tech details for nerds

VSCode should have filled in the command prompt before “Hello World” with something along the lines of & python c:/example/hello.py .

The command prompt after “Hello World” should be available for you to type commands into.

Try typing “ python —version ” and hitting enter to confirm that you have a working command prompt to your computer through this panel of VSCode.)

You’ll be using the Terminal’s command prompt when you need to update extensions to Python, so you might as well try your first command in it.

Modules

Checking whether “modules” are installed

Now you need to learn what it looks like when a given extension to the Python language, also known as a “library” or “package” or, particularly in Python, a “module,” is installed.

Backspace out the entirety of your code and on line 1, type:

Click the “run” button.

If you get a dump of text in your console, saying the following, you now know that you don’t have the module called “ pandas ” installed:

Screenshot

If you do have “pandas” installed, nothing special happens.

If you have “pandas” installed, when you run this code, you just get a new command prompt (“ PS C:\Users\YOUR_USERNAME> ”) in the Terminal pane below.

Screenshot

Let’s fix things and install Pandas so our code runs.

Installing a “module”

When using the Windows Store installation of Python, you’ll use the “pip installer” to install extended Python commands (“modules”) onto your computer so that you can run Python code written with these extended commands.

PIP is just a command-line program that works in the command prompts of the Terminal pane of VSCode. It goes out and downloads things from the internet and installs them on your computer for you.

In the command prompt in your Terminal pane in VSCode, type the following and hit “enter” to execute:

Screenshot

You may notice that PIP downloaded a lot more than just “pandas.” There’s another package that’s highly intertwined with “pandas” called “numpy” that it’s going to download for us … we’ll check after we’re all done that it installed, too.

The download and install takes a few minutes.

The installation process is completete when you see a new command prompt (“ PS C:\Users\YOUR_USERNAME> ”) at the bottom of your the Terminal pane in VSCode.

Screenshot

Run your code again, which, as a reminder, looks like this:

Now you should get the boring “nothing happens except the command prompt incrementing” thing.

Screenshot

Note: If you’d like to see that the “numpy” module also installed, add a 2nd line of code to your program at left and click “Run” again, with the full code being:

Installing another module

The same process works for other Python modules, like Simple Salesforce, which makes it easier to download and update data in a Salesforce database.

Running the following code will produce an error if Simple Salesforce is not installed, but will do nothing if it is installed:

To install Simple Salesforce on your computer, just run this command in the VSCode Terminal command prompt:

Note: in pip commands, this module is “simple-salesforce” with a hyphen. When doing an “import” in Python code, it’s an underscore. Not sure why … that’s just how the author packaged it up.

Updating a “module”

Has it been a year, and you’ve heard there are newer & greater versions of Pandas?

At your prompt in the VSCode Terminal, run the following command:

Updating Python itself

If you have, say, version 3.8.0 and you want to bring your system up to the latest version offered in the Microsoft Store (for me today, that’s 3.8.6), you might be able to do so as described in “How to manually update apps and games from the Microsoft Store” by Ciprian Adrian Rusen for Digital Citizen.

If, on the other hand, you chose version 3.7 of Python and want to switch to version 3.8, I think the easiest way to ensure you keep your installation simple would be to simply uninstall Python the way you’d install any program from Windows, then reinstall it.

The only catch is that this will likely uninstall all the modules you’ve installed with pip. Maybe you want a clean start, but for this tutorial, we’ll take a backup of the list of those modules before we begin and reinstall them when done.

  1. In your VSCode Terminal panel, type the command pip freeze > c:\example\installed-modules.txt (changing the path of the filename to the right of > if you like) and press Enter to execute it.
    • Check out the file you just created – it should list out the Python modules installed on your computer.
  2. Click the Windows icon in the bottom-left corner of your screen, and then without clicking anything else, type the words “ add or remove programs .”
  3. The Windows start menu should filter your list of available programs to suggest the Add or remove programs system configuration area. Click it.
  4. In the “Search this list” box, type “ python ,” click your version of Python that you no longer want, and click the Uninstall button.
  5. You’re now in a bit of a weird nowhere-land, where executing a VSCode Terminal command of python —version neither gives you a version number nor denies that python is a legitimate Windows command. If you have a .py file open in VSCode, the bottom right corner also probably gives you a yellow warning message of “Select Python interpreter.” Hopefully we can move past that in a moment.
    • Nerd reason: The uninstall left behind python.exe in C:\Users\YOUR_USERNAME\AppData\Local\Microsoft\WindowsApps\ , so it’s still a valid Windows program.
    • However, that program’s job seems to be to simply call the python.exe from a sub-folder (e.g. PythonSoftwareFoundation.Python.#.#_LONGWEIRDTEXT ) with an actual versioned installation of Python in it, so executing python just kind of … does nothing.
  6. Once the Windows Store finishes installing your new version of Python, close out any .py files you have open in VSCode.
  7. Re-open a .py file such as hello.py that we wrote earlier. VSCode should automatically find your new Python interpreter and put your latest version number into the bottom-left corner.
  8. Run your Python file to make sure it works.
    • Tip: Choose a Python file that doesn’t do anything dangerous. Don’t, for example, choose a Python file you once wrote whose job is to delete a bunch of files. Use a simple Hello World script.
  9. To restore your old module installations, run the following code in the VSCode Terminal: pip install -r c:\example\installed-modules.txt (alter the file path if you saved it somewhere else)
  10. Run a Python file containing import statements in the code to verify that your expected modules are now in place, as done above with import pandas and import numpy and import simple_salesforce .

After updating Python, you might also want to update all of your modules at once to their latest versions.

You can do so with the following command suggested in this blog post by ActiveState:

Updating all modules at once
Updating PIP

Funnily, pip itself doesn’t get upgraded when you “update everything,” so if you’re seeing nastygrams that it’s out-of-date, you can also run:

Happy Programming

You now have a working environment for editing CSV files in Python!

  1. You have an “IDE,” or as I like to think of it, a “text editor with a run button,” called VSCode, that runs code you type into it as you see fit.
  2. You know how to install & update “modules” that you hear might be useful.
    (Be careful and don’t trust any old module you find on the internet. It’s nothing more than “custom code that you’re running on your computer. Make sure it’s not from someone sketchy. Big names like pandas are fine, though.)

Door Prize

Here’s a “door prize script” to get you started: try copying & pasting it into hello.py in VSCode and running it.

You should see the following output in your console at right:

Screenshot

Now you’ve opened a CSV spreadsheet file with Python – you’re off to the races! Head here to learn new skills and put them in action on your computer.

Читать:
Почему компьютер сам выходит из спящего режима

Похожие статьи