# Remove any rows that contain NaN values code example
Example 1: how to remove rows with nan in pandas
df.dropna(subset=[columns],inplace=True)
Example 2: remove rows or columns with NaN value
df.dropna() #drop all rows that have any NaN values
df.dropna(how='all')