---
source: https://iinventedlight.com/library/notes/numpy-dtypes.md
title: "NumPy data types (dtype)"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (numpy/numpy LICENSE.txt; Copyright (c) 2005-2026, NumPy Developers; https://github.com/numpy/numpy/blob/main/LICENSE.txt); prose restates or closely paraphrases cited source lines"
license_family: numpy-bsd3
rule_check: "needs rule check (family not in auto-publish rule; check.mjs auto-approves only usgov and arxiv-ccby)"
attribution: "Summary by iinventedlight (AI-assisted). Sources: NumPy docs, Data types — NumPy v2.5 Manual, BSD-3-Clause (numpy/numpy LICENSE.txt; Copyright (c) 2005-2026, NumPy Developers; https://github.com/numpy/numpy/blob/main/LICENSE.txt); NumPy docs, NumPy: the absolute basics for beginners — NumPy v2.5 Manual, BSD-3-Clause (numpy/numpy LICENSE.txt; Copyright (c) 2005-2026, NumPy Developers; https://github.com/numpy/numpy/blob/main/LICENSE.txt)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-ai-eng: NumPy"
tags: ['numpy', 'dtype', 'types']
sources:
  - id: S1
    title: "Data types — NumPy v2.5 Manual"
    publisher: NumPy docs
    url: https://numpy.org/doc/stable/user/basics.types.html
    accessed: 2026-11-04
    license: "BSD-3-Clause (numpy/numpy LICENSE.txt; Copyright (c) 2005-2026, NumPy Developers; https://github.com/numpy/numpy/blob/main/LICENSE.txt)"
  - id: S2
    title: "NumPy: the absolute basics for beginners — NumPy v2.5 Manual"
    publisher: NumPy docs
    url: https://numpy.org/doc/stable/user/absolute_beginners.html
    accessed: 2026-11-04
    license: "BSD-3-Clause (numpy/numpy LICENSE.txt; Copyright (c) 2005-2026, NumPy Developers; https://github.com/numpy/numpy/blob/main/LICENSE.txt)"
---
# NumPy data types (dtype)

**Answer:** NumPy supports a much greater variety of numerical types than Python does. NumPy numerical types are instances of numpy.dtype (data-type) objects, each having unique characteristics. (S1)

## Basics

- There are 5 basic numerical types representing booleans (bool), integers (int), unsigned integers (uint) floating point (float) and complex. (S1)
- You can create arrays with a specified dtype using the scalar types in the numpy top-level API, e.g. numpy.bool, numpy.float32. (S1)
- dtype objects also contain information about the type, such as its bit-width and its byte-order. (S1)
- To convert the type of an array, use the .astype() method. (S1)

## In practice

- All elements of the array must be of the same type of data. (S2)
- The data type is recorded in the dtype attribute. (S2)
- While the default data type is floating point (np.float64), you can explicitly specify which data type you want using the dtype keyword. (S2)

## Claims
- id: C1
  claim: NumPy has more numerical types than Python.
  source: S1
  evidence: "NumPy supports a much greater variety of numerical types than Python does."
- id: C2
  claim: Use .astype() to convert an array's type.
  source: S1
  evidence: "To convert the type of an array, use the .astype() method."
- id: C3
  claim: All array elements share one data type.
  source: S2
  evidence: "All elements of the array must be of the same type of data."
- id: C4
  claim: The default data type is np.float64.
  source: S2
  evidence: "While the default data type is floating point (np.float64)"

## Sources
- [S1] Data types — NumPy v2.5 Manual. NumPy docs. https://numpy.org/doc/stable/user/basics.types.html . License: BSD-3-Clause (numpy/numpy LICENSE.txt; Copyright (c) 2005-2026, NumPy Developers; https://github.com/numpy/numpy/blob/main/LICENSE.txt). Accessed 2026-11-04.
- [S2] NumPy: the absolute basics for beginners — NumPy v2.5 Manual. NumPy docs. https://numpy.org/doc/stable/user/absolute_beginners.html . License: BSD-3-Clause (numpy/numpy LICENSE.txt; Copyright (c) 2005-2026, NumPy Developers; https://github.com/numpy/numpy/blob/main/LICENSE.txt). Accessed 2026-11-04.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
