How to Install Pandas on Windows

To install Pandas on Windows, we need to use Python and pip. First, we will see how to install Pandas on Windows, and after that, we will also see some external platforms to install Pandas.

Install Pandas on Windows (without using any platform)

Let us see how to install Pandas on Windows. We will only use Python and pip, i.e., we won’t use any external platform. The pip is used to download and install Python packages.

Here is the video tutorial to install Pandas on Windows:

After installing Python and pip, open CMD and use pip to install Pandas. Type the following command and press Enter (we have used the same command in the above video tutorial):

pip install pandas

Install Pandas using various platforms

The above will install Pandas on Windows. You can also use any of the following Python Distributions/ Platforms to run your first Pandas program:

  1. Pandas on VS Code
  2. Pandas on Anaconda
  3. Pandas on PyCharm
  4. Pandas on Google Colab

Let us see the some by one.

1. Install Pandas on VS Code

2. Install Pandas on Anaconda

Before moving further, we’ve prepared a video tutorial to install Pandas on Windows:

3 Install Pandas on PyCharm

4. Install Pandas on Google Colab

Run the first Pandas program

Now, let us run our first Pandas program. In the sample program, we need to first import the Pandas after installing:

import pandas

To avoid writing pandas, again and again, we can also use an alias i.e.

import pandas as pd

Let us now see the following Pandas code which can be run in any of the Python Distributions. Do notice that we have imported pandas at the top:

import pandas as pd

data = {
  'student': ["Amit", "John", "Jacob", "David", "Steve"],
  'rank': [1, 4, 3, 5, 2]
}

res = pd.DataFrame(data)

print("Student Records\n\n",res)

Output

Student Records

   student  rank
0    Amit     1
1    John     4
2   Jacob     3
3   David     5
4   Steve     2

In the above program, we have created a dataset and added it to the DataFrame() method.  To understand what a DataFrame is and its purpose, let us see the next lesson. The 0, 1, 2, etc. are the index that get automatically added to the table.

If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


For Videos, Join Our YouTube Channel: Join Now


Read More:

Pandas Tutorial
DataFrames in Pandas
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment