Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python convert number in array to integer

A = np.array((0.4, 1.6, 2.1, -3.7, 2.9))
>>> A
array([ 0.4,  1.6,  2.1, -3.7,  2.9])
>>> A = A.astype(int)
>>> A
array([ 0,  1,  2, -3,  2])
Comment

PREVIOUS NEXT
Code Example
Python :: sorted vs sort python 
Python :: how to print two lists side by side in python 
Python :: swapping of two numbers in python 
Python :: km/h a m/s 
Python :: how to find the number of times a number appears in python 
Python :: how to tell if member is a bot discord.py 
Python :: get python path 
Python :: pipenv with specific python version 
Python :: Make a Basic Face Detection Algorithm in Python Using OpenCV and Haar Cascades 
Python :: random python 
Python :: python how to find gcd 
Python :: remove element from list python 
Python :: generate random number from range python 
Python :: basic calculator in python 
Python :: choromap = go.Figure(data=[data], layout = layout) 
Python :: python append n numbers to list 
Python :: pandas create new column conditional on other columns 
Python :: turtle example in python 
Python :: get sum of a range from user input 
Python :: Return a Series containing counts of unique values. 
Python :: increase a date in python 
Python :: how store list in django session 
Python :: pyspark split dataframe by rows 
Python :: extract pdf with python 
Python :: python printing to a file 
Python :: for loop with index python3 
Python :: how can item in list change in int in python 
Python :: python print numbers 1 to 10 in one line 
Python :: python tar a directory 
Python :: web crawler using python 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =