Skip to content

Instantly share code, notes, and snippets.

View thomascamminady's full-sized avatar

Thomas thomascamminady

View GitHub Profile
@thomascamminady
thomascamminady / drop_columns_that_are_all_null.py
Created September 20, 2023 07:40
Polars drop columns that are all null
import polars as pl
def drop_columns_that_are_all_null(_df: pl.DataFrame) -> pl.DataFrame:
return _df[[s.name for s in _df if not (s.null_count() == _df.height)]]