1import numpy as np
2
3# for example, numpy.float32 -> python float
4val = np.float32(0)
5pyval = val.item()
6print(type(pyval)) # <class 'float'>
7
8# and similar...
9type(np.float64(0).item()) # <class 'float'>
10type(np.uint32(0).item()) # <class 'long'>
11type(np.int16(0).item()) # <class 'int'>
12type(np.cfloat(0).item()) # <class 'complex'>
13type(np.datetime64(0, 'D').item()) # <class 'datetime.date'>
14type(np.datetime64('2001-01-01 00:00:00').item()) # <class 'datetime.datetime'>
15type(np.timedelta64(0, 'D').item()) # <class 'datetime.timedelta'>
16...