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 ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Classe « Index »

Méthode pandas.Index.round

Signature de la méthode round

def round(self, decimals: 'int' = 0) -> 'Self' 

Description

help(Index.round)

Round each value in the Index to the given number of decimals.

Parameters
----------
decimals : int, optional
    Number of decimal places to round to. If decimals is negative,
    it specifies the number of positions to the left of the decimal point.

Returns
-------
Index
    A new Index with the rounded values.

Examples
--------
>>> import pandas as pd
>>> idx = pd.Index([10.1234, 20.5678, 30.9123, 40.4567, 50.7890])
>>> idx.round(decimals=2)
Index([10.12, 20.57, 30.91, 40.46, 50.79], dtype='float64')



Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé