On this page
numpy.fix
- numpy.fix(x, out=None)[source]
- 
    Round to nearest integer towards zero. Round an array of floats element-wise to nearest integer towards zero. The rounded values are returned as floats. - Parameters
- 
      - xarray_like
- 
        An array of floats to be rounded 
- outndarray, optional
- 
        A location into which the result is stored. If provided, it must have a shape that the input broadcasts to. If not provided or None, a freshly-allocated array is returned. 
 
- Returns
- 
      - outndarray of floats
- 
        A float array with the same dimensions as the input. If second argument is not supplied then a float array is returned with the rounded values. If a second argument is supplied the result is stored there. The return value outis then a reference to that array.
 
 Examples>>> np.fix(3.14) 3.0 >>> np.fix(3) 3.0 >>> np.fix([2.1, 2.9, -2.1, -2.9]) array([ 2., 2., -2., -2.])
© 2005–2020 NumPy Developers
Licensed under the 3-clause BSD License.
 https://numpy.org/doc/1.19/reference/generated/numpy.fix.html