---
source: https://iinventedlight.com/library/notes/hf-datasets-map-filter.md
title: "Hugging Face Datasets: map, filter, select, and other row and column operations"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (huggingface/datasets docs); restated in our own words"
attribution: "Summary by iinventedlight (AI-assisted). Sources: Hugging Face, Datasets docs: Process, Apache-2.0 (huggingface/datasets docs); Hugging Face, Know your dataset, Apache-2.0 (huggingface/datasets docs)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-05
as_of: 2026-11-05
confidence: medium
untested: "Steps and code were not run; only the fetched documentation page was read."
category: huggingface-datasets
topic_area: "hf: processing datasets"
tags: huggingface, datasets, python, ml-data
sources:
  - id: S1
    title: "Datasets docs: Process"
    publisher: Hugging Face
    url: https://huggingface.co/docs/datasets/process
    accessed: 2026-11-05
    license: "Apache-2.0 (huggingface/datasets docs)"
  - id: S2
    title: "Know your dataset"
    publisher: Hugging Face
    url: https://huggingface.co/docs/datasets/access
    accessed: 2026-11-05
    license: "Apache-2.0 (huggingface/datasets docs)"
    license: "Apache-2.0 (huggingface/datasets docs)"
---
# Hugging Face Datasets: map and filter

## Short answer
`Dataset.map` transforms rows; `filter` and `select` drop or keep them. Processing returns a new dataset and can run in batches or multiple processes. [S1]

## Points
- Use `select()` or `filter()` to keep rows. [S1]
- Set `batched=True` to operate on batches (default size 1000). [S1]
- Indexing a dataset returns a row as a dictionary of column values. [S2]
- A Dataset holds columns that may each have a different type. [S2]

## Claims
- id: C1
  claim: select and filter are the two options for filtering rows.
  source: S1
  evidence: "select() and filter()"
- id: C2
  claim: batched=True runs map on batches.
  source: S1
  evidence: "Operate on batches by setting batched=True"
- id: C3
  claim: Indexing by row returns a dictionary example.
  source: S2
  evidence: "indexing by the row returns a dictionary of an example from the dataset"
- id: C4
  claim: A Dataset contains typed columns.
  source: S2
  evidence: "A Dataset contains columns of data, and each column can be a different type"

## Sources
- [S1] Datasets docs: Process. Hugging Face. https://huggingface.co/docs/datasets/process . License: Apache-2.0 (huggingface/datasets docs). Accessed 2026-11-05.
- [S2] Know your dataset. Hugging Face. https://huggingface.co/docs/datasets/access . License: Apache-2.0 (huggingface/datasets docs). Accessed 2026-11-05.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

Source notice: Hugging Face Datasets documentation, Apache License 2.0 (https://github.com/huggingface/datasets/blob/main/LICENSE).
