Professional Documents
Culture Documents
Syntax
The set_axis() method modifying column names
In df.set_axis(['a','b','c'],axis = 'columns',inplace = True)
The isnull() and isna() methods for finding The dropna() method for deleting
missing values missing values
In
df.isnull() In df.dropna()
df.isna() # delete all rows containing
# at least one missing value
The duplicated() method for finding duplicates The drop_duplicates() method for finding duplicates
In df.duplicated() df.drop_duplicates().reset_index(drop
In
= True)
# Along with the method sum() - returns # the argument drop with the value True,
# the total number of duplicates # so you avoid creating a column with
df.duplicated().sum() # old index values
'''
The unique() method for seeing all When calling the method
unique values in a column drop_duplicates() along with repeating
In df['column'].unique() rows, their indices are deleted, at
which point the method reset_index()
is used.
'''