pyspark.sql.functions.floor

pyspark.sql.functions.floor(col: ColumnOrName) → pyspark.sql.column.Column[source]

Computes the floor of the given value.

New in version 1.4.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

column to find floor for.

Returns
Column

nearest integer that is less than or equal to given value.

Examples

>>> df = spark.range(1)
>>> df.select(floor(lit(2.5))).show()
+----------+
|FLOOR(2.5)|
+----------+
|         2|
+----------+