Datatype sizes
Integers
int8int16int32(intfor 32bits)int64(intfor 64bits)uint8uint16uint32uint64
np.array([2**32], dtype=np.int32).dtype
# shows deprecation warning because of out-of-bound integer
# conversion to smaller data sizeWe can check the size of numpy integer datatype using method np.iinfo.
np.iinfo(np.int32)
# iinfo(min=-2147483648, max=2147483647, dtype=int32)Floats
To check the size of float integers, we can use method np.finfo.
np.finfo(np.float64)
# finfo(resolution=1e-15, min=-1.7976931348623157e+308, max=1.7976931348623157e+308, dtype=float64)Available floats,
float16float32float64float96platform dependent (ornp.longdouble)float128platform dependent (ornp.longdouble)
np.finfo(np.float32).eps
# 1.1920929e-07Note
epsis machine epsilon which defines round off error for float numbers.
Complex numbers
complex64two bits floatscomplex128two bits floatscomplex192two bits floats, platform depedentcomplex256two bits floats, platform depedent