AI engineering glossary · NumPy pandas visualization
What is dtype?
dtype (also called data type): The data type of every element in a NumPy array, such as int64, float32 or bool. It fixes how many bytes each value uses and how the bytes are interpreted. Choosing a smaller type saves memory, while a type that is too small can lose precision or overflow.
dtype: an example
np.array([1.5, 2.5], dtype=np.float32).dtype gives float32, so each number takes 4 bytes instead of the 8 bytes of float64.
Related terms
- ndarray
- Type casting
- NumPy integer overflow
- Floating point
More NumPy pandas visualization terms
Where you learn it
dtype is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.