using pandas query() to filter out nan code example Example: pandas filter non nan filtered_df = df[df['name'].notnull()]