Python Pandas Library dropna function

27 June 2023 366 Reading time: 16 second

The dropna function in the Pandas library is used to remove rows or columns with missing values from a DataFrame. This function is often used to clean data with missing values or perform operations based on missing values.


import pandas as pd

# Remove rows with missing values
cleaned_df = df.dropna()
print(cleaned_df)

Similar articles