Articles → Numpy → Trunc Function In Numpy

Trunc Function In Numpy






Purpose





Example


import numpy as np

in_array = np.array([-9.5, -0.5, 0, 1.5,5.5] )


print("Trunc Operation:", np.trunc(in_array))



Output


Picture showing the output of the trunc function in numpy
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, June 24, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250