How to convert python int into numpy.int64?
import numpy as np
z = 3
z = np.dtype('int64').type(z)
print(type(z))
outputs:
<class 'numpy.int64'>
But i support Juliens question in his comment.
z_as_int64 = numpy.int64(z)
It's that simple. Make sure you have a good reason, though - there are a few good reasons to do this, but most of the time, you can just use a regular int
directly.