Skip to main content

every

Returns true if all values of col are true.

Syntax​

Python
from pyspark.sql import functions as sf

sf.every(col)

Parameters​

Parameter

Type

Description

col

pyspark.sql.Column or column name

Column to check if all values are true.

Parameter

Type

Description

col

pyspark.sql.Column or column name

Column to check if all values are true.

Returns​

pyspark.sql.Column: true if all values of col are true, false otherwise.

Examples​

Python
import pyspark.sql.functions as sf
spark.createDataFrame(
[[True], [True], [True]], ["flag"]
).select(sf.every("flag")).show()
Output
+-----------+
|every(flag)|
+-----------+
| true|
+-----------+
Python
import pyspark.sql.functions as sf
spark.createDataFrame(
[[True], [False], [True]], ["flag"]
).select(sf.every("flag")).show()
Output
+-----------+
|every(flag)|
+-----------+
| false|
+-----------+