Sitemap
3 min readJul 31, 2022

14 Pandas functions for Data Science

Press enter or click to view image in full size

You can’t avoid Pandas if you are learning Data Science.

Here are the Most Commonly used 15 Functions in Pandas and a short introduction to each.

1.read_csv: It helps you to read Comma Separated File into a Data Frame

Press enter or click to view image in full size
Reading files from Github using separators

2. head(): It will display the Top 5 Rows in your Dataset.
If you want the top 10 rows you can pass that to the function like head(10)

Press enter or click to view image in full size

3. describe(): It will give you a description of your data. What description does it give? Description in the sense of Mean, Standard Deviation, max and min value, etc

Press enter or click to view image in full size

4. info(): It will give you the summary of the list of all columns with their data types and the number of non-null values in each column.

Press enter or click to view image in full size

5. value_counts(): It will return you the count of Unique Values in a Particular Column

Press enter or click to view image in full size

6. columns(): When no of Columns in the Dataset is high, we can’t check all the columns. So this will help to display all the columns

Press enter or click to view image in full size

7. groupby(): It groups the data based on the feature(column name) you pass to that function

Press enter or click to view image in full size

8. astype(): This Function helps to convert a particular column data type to another data type

Press enter or click to view image in full size

9 .loc(): It will fetch the data in a Data Frame using the Labels. Labels are Column Names or Indexes
.iloc() It will fetch the data in a Data Frame using the Positions.

Press enter or click to view image in full size
Press enter or click to view image in full size

10. isnull() it will return True if there is a Null Value and False in the other case If you want the total sum of null values, you can use isnull().sum()

Press enter or click to view image in full size

11. fillna() Ok if you want to fill the null values you can use fillna()

Press enter or click to view image in full size

12. dropna() It drops the entire row if it contains even a single NULL VALUE

Press enter or click to view image in full size

13. dataframe() It converts a list or a dictionary into a Dataframe object

Press enter or click to view image in full size

14. merge(): It is simply merging DataFrame or Series objects. It Provides database join-like operations like Inner Join, Outer Join, etc in order to merge.

Press enter or click to view image in full size

I hope that you will find this article insightful. If you like to, please share the link with your friends, family, and colleagues. Please encourage us with a cup of coffee

For any suggestions/feedback please comment. Also please consider following and subscribing using my link.