14 Pandas functions for Data Science
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
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)
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
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.
5. value_counts(): It will return you the count of Unique Values in a Particular Column
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
7. groupby(): It groups the data based on the feature(column name) you pass to that function
8. astype(): This Function helps to convert a particular column data type to another data type
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.
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()
11. fillna() Ok if you want to fill the null values you can use fillna()
12. dropna() It drops the entire row if it contains even a single NULL VALUE
13. dataframe() It converts a list or a dictionary into a Dataframe object
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.
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.