Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé
Module « numpy.matlib »

Fonction fix - module numpy.matlib

Signature de la fonction fix

def fix(x, out=None) 

Description

help(numpy.matlib.fix)

Round to nearest integer towards zero.

Round an array of floats element-wise to nearest integer towards zero.
The rounded values have the same data-type as the input.

Parameters
----------
x : array_like
    An array to be rounded
out : ndarray, 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
-------
out : ndarray of floats
    An array with the same dimensions and data-type as the input.
    If second argument is not supplied then a new array is returned
    with the rounded values.

    If a second argument is supplied the result is stored there.
    The return value ``out`` is then a reference to that array.

See Also
--------
rint, trunc, floor, ceil
around : Round to given number of decimals

Examples
--------
>>> import numpy as np
>>> np.fix(3.14)
3.0
>>> np.fix(3)
3
>>> np.fix([2.1, 2.9, -2.1, -2.9])
array([ 2.,  2., -2., -2.])



Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé