python: converting an numpy array data type from int64 to int
numpy.ndarray.tolist will do it:
a.tolist()
If your data is a pandas series you can call their tolist wrapper with the same result.
@J.F. Sebastian's answer:
a.astype(numpy.int32)
Use the item()
method for numpy.int64
object, as Mike T's answer in another similar question explained.
Official documentation is here: https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.chararray.item.html#numpy.chararray.item