Skip to content

Instantly share code, notes, and snippets.

@PM25
Last active December 15, 2020 14:26
Show Gist options
  • Save PM25/9f7775b0cf8aec3fcaf73c367cd81364 to your computer and use it in GitHub Desktop.
Save PM25/9f7775b0cf8aec3fcaf73c367cd81364 to your computer and use it in GitHub Desktop.
Pandas
import pandas as pd
def get_columns_with_nan(df):
nan_values = df.isna()
nan_columns = nan_values.any()
columns_with_nan = df.columns[nan_columns].tolist()
return columns_with_nan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment