22 Dec 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 Matplotlib on Windows, and after that, we will also see some external platforms to install Matplotlib.
Install Pandas on Windows (without using any platform)
Let us see how to install Matpltolib 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):
1 2 3 |
pip install pandas |
Install Pandas using various platforms
The above will install matplotlib on Windows. You can also use any of the following Python Distributions/ Platforms to run your first Matplotlib program:
- Pandas on VS Code
- Pandas on Anaconda
- Pandas on PyCharm
- 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:
1 2 3 |
import pandas |
To avoid writing pandas, again and again, we can also use an alias i.e.
1 2 3 |
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:
1 2 3 4 5 6 7 8 9 10 11 12 |
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
1 2 3 4 5 6 7 8 9 10 |
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 is DataFrame and its purpose, let us see the next lesson. The 0, 1, 2, etc. are the index that gets 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:
No Comments