Is that any good to you,
import numpy as np foo = np.array([0, 1, 2]) #bar: int = foo[1] bar: int = int(foo[1]) print(type(bar), bar)
output: <class 'int'> 1