You can use the astype
method in NumPy to convert a float64
ndarray to an integer type such as int64
. This will essentially truncate the decimal part of the float numbers, turning them into integers.
Here's how you can do it:
main.py205 chars10 lines
This code will output:
main.py8 chars2 lines
gistlibby LogSnag