---
title: NumPy formatting controls dataset reads, not the stored table
slug: hf-datasets-numpy-format
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source: https://iinventedlight.com/library/notes/hf-datasets-numpy-format.md
source_license: Apache-2.0
attribution: Original synthesis by iinventedlight, drafted by Librarian with AI assistance; based on the attributed sources
  below.
author: Librarian
client: Librarian
date: '2026-11-05'
checked_on: '2026-11-05'
as_of: '2026-11-05'
status: published
confidence: medium
category: coding-references
tags:
- hf
- datasets
- numpy
untested: Reference note. No code or commands were run to validate behavior.
sources:
- id: S1
  title: Use with NumPy
  publisher: Hugging Face contributors
  url: https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/use_with_numpy.mdx
  accessed: '2026-11-05'
  license: Apache-2.0
  license_url: https://raw.githubusercontent.com/huggingface/datasets/main/LICENSE
  license_verified: '2026-11-05'
  green: true
  attribution: Hugging Face contributors; Use with NumPy; Apache-2.0
  snapshot: _fetched/hf-format.txt
- id: S2
  title: Process
  publisher: Hugging Face contributors
  url: https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/process.mdx
  accessed: '2026-11-05'
  license: Apache-2.0
  license_url: https://raw.githubusercontent.com/huggingface/datasets/main/LICENSE
  license_verified: '2026-11-05'
  green: true
  attribution: Hugging Face contributors; Process; Apache-2.0
  snapshot: _fetched/hf-process.txt
---
# NumPy formatting controls dataset reads, not the stored table

## Summary
`with_format("numpy")` makes supported values appear as NumPy arrays when read. Without a requested format, Datasets returns ordinary Python objects. [S1]

## Details
Fixed-shape nested data can form a single multidimensional array. Varying shapes may instead produce object arrays containing separate arrays. The NumPy guide recommends an explicit Array feature with a declared shape to avoid repeated shape checks and copies. Formatting can target selected columns, and it can be reset with `None`. [S1, S2]

## Claims
- id: C1
  claim: "Unformatted reads return regular Python values."
  source: S1
  evidence: "By default, datasets return regular Python objects"
- id: C2
  claim: "An explicit Array feature can declare the tensor shape."
  source: S1
  evidence: "specify the shape of your tensors"
- id: C3
  claim: "Formatting can be reset to its original behavior with None."
  source: S2
  evidence: "set the format to `None`"

## Sources
- [S1] Use with NumPy. Hugging Face contributors. https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/use_with_numpy.mdx. Apache-2.0; license: https://raw.githubusercontent.com/huggingface/datasets/main/LICENSE. Accessed 2026-11-05.
- [S2] Process. Hugging Face contributors. https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/process.mdx. Apache-2.0; license: https://raw.githubusercontent.com/huggingface/datasets/main/LICENSE. Accessed 2026-11-05.

## Attribution and notices
This note is CC BY 4.0. Source material has been condensed and restated; short evidence excerpts retain their source license.

Hugging Face Datasets documentation is Apache-2.0. This note restates the documentation and includes only short evidence excerpts. See the accompanying source license.
