Note
Kailangan ng pahintulot para ma-access ang page na ito. Maaari mong subukang mag-sign in o magpalit ng mga direktoryo.
Ang pag-access sa pahinang ito ay nangangailangan ng pahintulot. Maaari mong subukang baguhin ang mga direktoryo.
Returns the bitwise XOR of all non-null input values, or null if none.
Syntax
from pyspark.sql import functions as sf
sf.bit_xor(col)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
Target column to compute on. |
Returns
pyspark.sql.Column: the bitwise XOR of all non-null input values, or null if none.
Examples
Example 1: Bitwise XOR with all non-null values
from pyspark.sql import functions as sf
df = spark.createDataFrame([[1],[1],[2]], ["c"])
df.select(sf.bit_xor("c")).show()
+----------+
|bit_xor(c)|
+----------+
| 2|
+----------+
Example 2: Bitwise XOR with some null values
from pyspark.sql import functions as sf
df = spark.createDataFrame([[1],[None],[2]], ["c"])
df.select(sf.bit_xor("c")).show()
+----------+
|bit_xor(c)|
+----------+
| 3|
+----------+