📜  numpy int64 到 int - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:29.814000             🧑  作者: Mango

代码示例1
import numpy as np

# for example, numpy.float32 -> python float
val = np.float32(0)
pyval = val.item()
print(type(pyval))         # 

# and similar...
type(np.float64(0).item()) # 
type(np.uint32(0).item())  # 
type(np.int16(0).item())   # 
type(np.cfloat(0).item())  # 
type(np.datetime64(0, 'D').item())  # 
type(np.datetime64('2001-01-01 00:00:00').item())  # 
type(np.timedelta64(0, 'D').item()) # 
...