An image

Corporate Blogs

Top Panda Functions You Should Know

E-Commerce Businesses Need a Mobile App

Python is one of the versatile and easy to learn software languages. Here we are going to concentrate on Pandas. Pandas is a software library written in Python language. It is one of the go-to software for data analysis and data manipulation which is nothing but organizing data into a user-friendly format. This library is built with functions like NumPy, SciPy, and Matplotlib. Pandas is mainly used in data analysis and data manipulations which are nothing but organizing data into a more user-friendly format. All you need to have to work on Pandas is given below.

Install Pandas in Python

  •  Run this command to install pandas.
  • A decent knowledge of python. If you are new to python I would recommend you go through some basic tutorials on python and continue further.

Python Basics: Lists, Dictionaries, & Booleans | Python

Goals of this blog

Understanding and playing around with basic commands in Pandas. For better understanding, you can use the repo here.

Before getting into the commands, let’s quickly go through the basic terms generally used in Pandas. Dataframe is nothing but a table with multiple columns, it can be of single dimension or multi-dimensional and series is one single column of the data frame.

ALSO READ: MongoDB In Golang With Examples – A Beginner’s Guide

Now, let’s start by reading the CSV file. A CSV (comma separated values) files are actually tables in the text version. It is basically separated by commas.

Read a CSV file

Output:

To read the first few values, we use the head function.

Output:

To read a few values from the bottom we use tail functions

Output:

To read the column name in CSV file

Output:

To read specific column name

Output:

To read specific row

Output:

To print the value of  specific row and columns

Output:

To view only the results for a particular condition

Output: 

To  find the statistics for numerical columns

df.mean() This will return the mean of all columns
df.corr() This will return the correlation between columns in a DataFrame
df.count() This will return the number of non-null values in each DataFrame column
df.max() This will return the highest value in each column
df.min() This will return  the lowest value in each column
df.median() This will return the median of each column
df.std() This will return the standard deviation of each column
Output:

To add the column in the existing data frame.

For example, let’s say the sum of some columns 

Output: 

To delete the column

Output:

To add multiple columns

In the following code, you might notice ‘:’ which refers to all the rows and that 4:9 refers to from column 4 to column 9.

Output:

To  filter the data

Output: 

Here in this blog, basic commands used in pandas are covered to help you better understand the essential Panda functions.

Do you find it interesting? you might also like these articles. Top 10 Best Tech Companies For Employees To Work In The USA In 2020 and Top 10 IT Staffing and Recruiting Agencies in the USA.

If you have a business idea in your mind and in search of a reliable web development company, you are in the right place. Hire the best Python developers in the industry from Agira technologies.

Looking for a Tech partner to dominate the digital world?
Professional Life of an IT Consultant Interview with Valentin Crettaz
Written by
Preethi is an enthusiactic developer and a quick learner. She loves reading books and gardening.

Leave a Comment


You have an Idea. We have the Solution.

We help business evolve with lates technologies and infrastructures tailored to their needs and market trends.