Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns true if at least one value of col is true.
Syntax
from pyspark.sql import functions as sf
sf.some(col)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
Column to check if at least one value is true. |
Returns
pyspark.sql.Column: true if at least one value of col is true, false otherwise.
Examples
import pyspark.sql.functions as sf
spark.createDataFrame(
[[True], [False], [True]], ["flag"]
).select(sf.some("flag")).show()
+----------+
|some(flag)|
+----------+
| true|
+----------+
import pyspark.sql.functions as sf
spark.createDataFrame(
[[False], [False], [False]], ["flag"]
).select(sf.some("flag")).show()
+----------+
|some(flag)|
+----------+
| false|
+----------+