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.

Answer from bigonazzi on Stack Overflow
🌐
Python.org
discuss.python.org › python help
Trying to convert an Int64Index to an Int - Python Help - Discussions on Python.org
June 25, 2022 - Hello! I am trying to refer to an index value as an integer. Does anyone know how to do this? index_value = data.index[data.timestamp == int(slice_end_timestamp)] My desired output is ‘220289’ Current output is: ‘Int64Index([220289], dtype=‘int64’)’ Thank you in advance.
Discussions

How to convert python int into numpy.int64? - Stack Overflow
Given a variable in python of type int, e.g. z = 50 type(z) ## outputs is there a straightforward way to convert this variable into numpy.int64? It appears one would have to More on stackoverflow.com
🌐 stackoverflow.com
np.int64 and np.uint64 casting to int creates an overflow with large numbers
Initial Checks I confirm that I'm using Pydantic V2 Description When using a BaseModel with field type of int. If you input a large numpy integer, the value held in that field differs from the ... More on github.com
🌐 github.com
4
August 1, 2024
Int64 to Int on Otree survey
I’m trying to host an Otree survey but I keep getting an error directed at this line of code that says “relevant_index should be set to int, not int64.” I have tried to use a.astype(int) but I’m still getting the error… can someone help me? def set_treatment_vars(self): # Set the ... More on discuss.python.org
🌐 discuss.python.org
0
0
June 8, 2023
to_dict doesn't convert np.int64 to python integers
# Your code here data = [{'id': ... int type(df[['id']].to_dict(orient='records')[0]['id']) # out: numpy.int64 · depending on the count of output columns, numpy integers getting converted to python integers... More on github.com
🌐 github.com
8
April 18, 2017
🌐
Reddit
reddit.com › r/learnpython › how to convert python int into numpy.int64?
r/learnpython on Reddit: How to convert python int into numpy.int64?
October 11, 2017 -

Given a variable in python of type int, e.g.

z = 50
type(z) 
## outputs <class 'int'>

is there a straightforward way to convert this variable into numpy.int64?

It appears one would have to convert this variable into a numpy array, and then convert this into int64. That feels quite convoluted.

https://docs.scipy.org/doc/numpy-1.13.0/user/basics.types.html

🌐
Google Groups
groups.google.com › g › numpy › c › 6nCcuw3NkKw
[Numpy-discussion] PyInt and Numpy's int64 conversion
Hi, I'm using Numpy from the C python api side while tweaking my SWIG interface to work with numpy array types. I want to convert a numpy array of integers (whose elements are numpy's 'int64') The problem is that it this int64 type is not compatible with the standard python integer type: I ...
🌐
GitHub
github.com › pydantic › pydantic › issues › 10016
np.int64 and np.uint64 casting to int creates an overflow with large numbers · Issue #10016 · pydantic/pydantic
August 1, 2024 - This issue doesnt persist if you cast the numpy integer to python int, so this could be a numpy bug 🐛 also 🤷 https://www.reddit.com/r/Python/comments/urwoto/whats_up_with_uint64_in_numpy/ import numpy as np from pydantic import BaseModel class Number(BaseModel): value: int integer = 8889891283923431349 np_integer = np.int64(integer) number = Number(value=integer) np_number = Number(value=np_integer) assert integer == np_integer assert integer == number.value assert np_integer == np_number.value ·
Author   Allaway11
🌐
Python.org
discuss.python.org › python help
Int64 to Int on Otree survey - Python Help - Discussions on Python.org
June 8, 2023 - I’m trying to host an Otree survey but I keep getting an error directed at this line of code that says “relevant_index should be set to int, not int64.” I have tried to use a.astype(int) but I’m still getting the error… can someone help me? def set_treatment_vars(self): # Set the Answers of the Social Group if self.treatment == 'IND': self.A1 = 4 self.A2 = 4 self.A3 = 1 self.A4 = 2 self.A5 = 2 elif self.treatme...
🌐
GitHub
github.com › pandas-dev › pandas › issues › 16048
to_dict doesn't convert np.int64 to python integers · Issue #16048 · pandas-dev/pandas
April 18, 2017 - # Your code here data = [{'id': 11, 'text': 'Osv1wbZoL'}, {'id': 0, 'text': 'KQpPReW3S9nZOS3'}, {'id': 0, 'text': 'cbqLhjrb0B2Ah6E'}, {'id': 3, 'text': 'qu1Jlnyba'}, {'id': 14, 'text': 'aJUv5DBjbcGc3'}, {'id': 12, 'text': 'Yobf9'}, {'id': 4, 'text': 'awzZCV'}, {'id': 4, 'text': '3NvBAVL'}, {'id': 11, 'text': '80sPCxIf9s5wmEZ1'}, {'id': 5, 'text': 'afrPD0X6mIzFK'}] df = pd.DataFrame(data) # out: # id int64 # text object # dtype: object type(df[['id', 'text']].to_dict(orient='records')[0]['id']) # out: int type(df[['id']].to_dict(orient='records')[0]['id']) # out: numpy.int64 · depending on the count of output columns, numpy integers getting converted to python integers ·
Author   kszucs
Find elsewhere
🌐
Python Forum
python-forum.io › thread-42567.html
System showing np.int64(xxx) as output
I was using Numpy and try to find the number in an array which is the closest to the number 57. I write the following code. a = np.array() x = 57 aThe output I get is Output:np.int64(63) instead of 63
🌐
GitHub
github.com › blaze › datashape › issues › 95
Discover Python int as int32 instead of int64 · Issue #95 · blaze/datashape
September 24, 2014 - Should we default to int32 for basic Python ints? This is more compatible with DyND and, I think, CPython itself. Current Behavior >>> discover(1) ctype("int64") Proposed Behavio...
Author   mrocklin
🌐
AskPython
askpython.com › home › how to convert float64 columns to int64 in pandas?
How to Convert float64 Columns to int64 in Pandas? - AskPython
February 27, 2023 - df = df.astype({"Work hrs":'int64', "Salary":'int64'}) ... It is evident from the above image that both columns selected have been converted into the int64 data type.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-fix-cant-adapt-type-numpyint64-1
How to Fix "Can't Adapt Type 'numpy.int64'"? - GeeksforGeeks
July 23, 2025 - In this example, the astype(int) method is used to convert the numpy.int64 array to a native Python integer array, which can then be inserted into the database without issues.
🌐
Librarycarpentry
librarycarpentry.github.io › library-python › 03-data-types-and-format
Python for Librarians: Data Types and Formats
August 1, 2018 - The type int64 tells us that Python is storing each value within this column as a 64 bit integer. We can use the dat.dtypes command to view the data type for each column in a DataFrame (all at once).
🌐
GitHub
github.com › numpy › numpy › issues › 12322
dtype(int) is int64 not python int · Issue #12322 · numpy/numpy
November 3, 2018 - np.dtype(int) is int64, not python int as expected. >>> import numpy as np >>> a = np.array([2],dtype = np.dtype(int)) >>> a.dtype dtype('int64') >>> a**63 array([-9223372036854775808]) >>> np.version.version '1.14.3' np.dtype(int) is expected to be Python compatible integer.
Author   ra1u
🌐
GeeksforGeeks
geeksforgeeks.org › pandas › how-to-convert-float64-columns-to-int64-in-pandas
How to Convert float64 Columns to int64 in Pandas? - GeeksforGeeks
July 23, 2025 - This enables the conversion of a column from various data types such as float or string to an integer type, specifically int64 or int32. We can use astype() method in Python to convert float64 Columns to int64 in Pandas.
🌐
Julia Programming Language
discourse.julialang.org › new to julia
Converting Int64 to Int8 - New to Julia - Julia Programming Language
November 23, 2021 - My objective to rewrite a data-analysis program written in Python that currently takes more than 24 hours, and cut it down to a few hours. The first hurdle is the following. From a bitstring (>300bit) I isolate 8-bit in an Int64 variable. The problem is that my 8-bit represents a signed integer.
🌐
Codegive
codegive.com › blog › numpy_int64_to_int.php
NumPy int64 to Python int
You can convert a NumPy array's dtype to object. This will make each element in the array store a Python object. However, this doesn't force the objects to be int. It will convert them to whatever Python scalar type is naturally represented by the NumPy type (e.g., np.int64 becomes Python int).
🌐
Saturn Cloud
saturncloud.io › blog › how-to-convert-a-float64-column-to-int64-in-pandas
How to Convert a Float64 Column to Int64 in Pandas | Saturn Cloud Blog
January 25, 2024 - Pandas, a widely used Python library for data analysis and manipulation, offers a range of functions to facilitate the cleaning and transformation of data. A typical operation involves converting a float64 column to an int64 column, and in the following article, we'll delve into the steps to ...