Facebook Page Twitter Page LinkedIn Page
× NumPy Tutorial NumPy Resources


NumPy supports a much greater variety of numerical types than Python does. Below is the list of most commonly used scalar data types defined in NumPy.

Data TypeDescription
bool_ Boolean (True or False) stored as a byte.
short 16-bit signed integer; Same as C short.
intc 32-bit signed integer; Same as C int.
int_ 64-bit signed integer; Same as Python int and C long.
int8 Byte (-128 to 127).
int16 Integer (-32768 to 32767).
int32 Integer (-2147483648 to 2147483647).
int64 Integer (-9223372036854775808 to 9223372036854775807).
uint8 Unsigned integer (0 to 255).
uint16 Unsigned integer (0 to 65535).
uint32 Unsigned integer (0 to 4294967295).
uint64 Unsigned integer (0 to 18446744073709551615).
intp Integer used for indexing, typically the same as ssize_t.
float_ Same as float64.
float16 16-bit-precision floating-point number type: sign bit, 5 bits exponent, 10 bits mantissa.
float32 32-bit-precision floating-point number type: sign bit, 8 bits exponent, 23 bits mantissa.
float64 64-bit precision floating-point number type: sign bit, 11 bits exponent, 52 bits mantissa.
double 64-bit precision floating-point number type: sign bit, 11 bits exponent, 52 bits mantissa. Same as Python float and C double.
complex_ Same as complex128.
complex64 Complex number, represented by two 32-bit floats (real and imaginary components).
complex128 Complex number, represented by two 64-bit floats (real and imaginary components).

NumPy numerical types are instances of dtype (data-type) objects, each having unique characteristics. Once NumPy is imported using:

import numpy as np

the dtypes are available as np.bool_, np.float32, etc.