Numpy fix()

This function is used to round the array values to the nearest integers towards zero.

Syntax

Parameters

  1. array: Array elements which are to be rounded.
  2. b: it is an Ndarray which is optional.

Return

An array containing the rounded values is returned.

Example

Output:

Input array: [0.23, 0.09, 1.2, 1.24, 9.99]
Output array: [0. 0. 1. 1. 9.]

Next TopicNumpy floor()




Latest Courses