mars.dataframe.Series.round#
- Series.round(decimals=0, *args, **kwargs)#
Round each value in a Series to the given number of decimals.
- 参数
decimals (int, default 0) – Number of decimal places to round to. If decimals is negative, it specifies the number of positions to the left of the decimal point.
- 返回
Rounded values of the Series.
- 返回类型
参见
numpy.around
Round values of an np.array.
DataFrame.round
Round values of a DataFrame.
实际案例
>>> import mars.tensor as mt >>> import mars.dataframe as md >>> s = md.Series([0.1, 1.3, 2.7]) >>> s.round().execute() 0 0.0 1 1.0 2 3.0 dtype: float64