הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Returns the double value that is closest in value to the argument and is equal to a mathematical integer. Supports Spark Connect.
For the corresponding Databricks SQL function, see rint function.
Syntax
from pyspark.sql import functions as dbf
dbf.rint(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
target column to compute on. |
Returns
pyspark.sql.Column: the column for computed results.
Examples
from pyspark.sql import functions as dbf
spark.range(1).select(dbf.rint(dbf.lit(10.6))).show()
spark.range(1).select(dbf.rint(dbf.lit(10.3))).show()
+----------+
|rint(10.6)|
+----------+
| 11.0|
+----------+
+----------+
|rint(10.3)|
+----------+
| 10.0|
+----------+