Arthur Camberlein >> SEO & Data articles >> Trouver et supprimer une colonne vide via Panda

Trouver et supprimer une colonne vide via Panda

Written by Arthur Camberlein | Published on & updated on

Rechercher et supprimer des colonnes vides dans le dataframe grâce/via Pandas en Python.

  # Find the columns where each value is null
cols_vides = [col for col in df.columns if df[col].isnull().all()]
# Drop these columns from the dataframe
df.drop(cols_vides,
        axis=1,
        inplace=True)

Trouver les columns avec des valeurs 'null'

cols_vides = [col for col in df.columns if df[col].isnull().all()]

Retirer ces colonnes de votre dataframe

df.drop(cols_vides, axis=1, inplace=True)
Retour au blog

Learn more with the article FAQ

Trouver et supprimer une colonne vide via Panda - FAQs

Blog post topic:  No topic assigned

Written by

With more than 10 years of experience in Marketing, Web Marketing and SEO, Arthur is specialized in Tech SEO and Data Analysis. He is currently working at Shopify, but all the views on this blog & website are his own.

Related Articles