Professional Documents
Culture Documents
import pandas as pd
• Unique Function - This function is used to get all unique values in a particular
column.
Syntax - series.unique()
Syntax - series.value_counts(normalize=False)
Parameters:
• Columns - This function will give the list of all the column names.
Syntax - df.columns
• Applymap - This method applies a function that accepts and returns a scalar to
every element of a DataFrame.
Syntax - df.applymap(func)
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
• Sort_Values function - This function sorts a dataframe in ascending or
descending order of a passed column
Parameters:
inplace- When inplace=True, then the sorting changes will be done in the original
dataset. When inplace=False, then the sorting changes will not overwritten in the
original dataset.
• Groupby function - Groupby function is used to split the data into several
groups bases on the given criteria. The abstract definition of grouping is to
provide a mapping of labels to group names. This function can be used to create
a pivot table.
Syntax- df.groupby(by="")
Parameters:
df.groupby() function will return groupby object. You can combine other
functions like min, max, std, mean, etc to analyze the data on the passed
function. Below is an example of passing groupby function where we need to find
the mean of each level of column A:
df.groupby(by="A").mean()
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.