Hugging Face · Datasets

Filter rows

Keep only rows that satisfy a condition.

ds = ds.filter(lambda row: len(row["text"]) > 50)

Official Hugging Face documentation

More datasets commands

All datasets commands · Hugging Face cheatsheet

Was this page helpful?