.item()
を使う
import numpy as np
# numpyのint64
np_int = np.int64(0)
print(type(np_int))
# <class 'numpy.int64'>
# pythonのintに変換
py_int = np_int.item()
print(type(py_int))
# <class 'int'>
参考
-
Converting numpy dtypes to native python types
-
https://stackoverflow.com/questions/9452775/converting-numpy-dtypes-to-native-python-types