Look for, find and delete/remove any empty column in a dataframe thanks to Python.
# Find the columns where each value is null empty_cols = [col for col in df.columns if df[col].isnull().all()] # Drop these columns from the dataframe df.drop(empty_cols, axis=1, inplace=True)
Find the columns where each value is null
empty_cols = [col for col in df.columns if df[col].isnull().all()]
Drop these columns from the dataframe
df.drop(empty_cols, axis=1, inplace=True)