Run
import pandas as pd import numpy as np # Take a DataFrame df = pd.DataFrame({ 'A': [1, 2, 3, np.nan], 'B': [5, np.nan, 7, 8], 'C': [9, 10, 11, np.nan]}) # Select rows without nan df_no_nan = df[df.notna().all(axis=1)] # Print the resulting dataframe print(df_no_nan)
Output