According to the docs, it's possible to specify different array dtypes:
dt = np.dtype('u1') # 8-bit unsigned integer
dt = np.dtype('i4') # 32-bit signed integer
dt = np.dtype('f8') # 64-bit floating-point number
dt = np.dtype('c16') # 128-bit complex floating-point number
dt = np.dtype('a25') # 25-length zero-terminated bytes
dt = np.dtype('U25') # 25-character string
However, the smallest unsigned integer dtype is 8-bit. Is there a way to create a 2-bit unsigned integer dtype?
According to the NumPy mailing list from November 2009, NumPy has 1-byte atomicity and so a 8-bit is the smallest unit. Even
bool
dtype uses a single byte.