四舍五入#

pylibcudf.round.RoundingMethod#

另请参阅 cudf::rounding_method

枚举成员

  • HALF_UP

  • HALF_EVEN

pylibcudf.round.round(Column source, int32_t decimal_places=0, rounding_method round_method=rounding_method.HALF_UP) Column#

将列中的所有值四舍五入到指定的小数位数。

详情请参阅 round()

参数:
sourceColumn

要进行四舍五入的列。

decimal_places: int32_t, 可选

四舍五入到的小数位数(默认为 0)

round_method: rounding_method, 可选

对每个值进行四舍五入的方法。可以是 { RoundingMethod.HALF_UP, RoundingMethod.HALF_EVEN } 之一(默认为 rounding_method.HALF_UP)

返回:
pylibcudf.Column

一个包含四舍五入值的列