A Basic Numpy Data Types List for Beginners – Numpy Tutorial

By | September 15, 2019

Numpy data type is called dtype, in this tutorial, we will list some common used numpy data types, which is much richer than python standard data types.

Here is the list of basic numpy data types, you should notice data types with underscore (_) is identical to standard python types.

bool_ Boolean, True or False.
byte One-byte signed integer.
short C-language short integer.
intc C-language int integer.
int_ Python int.
int8, int16, int32 Signed integers with 8, 16, and 32 bits respectively.
longlong Signed arbitrary-length integer.
intp An integer sized to hold a memory address.
ubyte Unsigned 8-bit integer.
ushort Unsigned C short.
uintc Unsigned C int.
uint Unsigned integer.
uint8, uint16, uint32 Unsigned integers of 8, 16, and 32 bits respectively.
ulonglong Unsigned arbitrary-length integer.
uintp Unsigned integer big enough to hold an address.
single Single-precision float.
float_ Python float.
longfloat Double-precision float.
float32, float64 Floats of 32 and 64 bits, respectively.
csingle Single-precision complex.
complex_ Python complex.
clongfloat Double-precision complex.
object_ For arrays of arbitrary Python objects.
str_ Eight-bit character string.
unicode_ Thirty-two-bit character string

float32, float64 and int32 is commond used in many python applications.