pyspark.sql.functions.bin

pyspark.sql.functions.bin(col)[source]

Returns the string representation of the binary value of the given column.

New in version 1.5.0.

Examples

>>> df.select(bin(df.age).alias('c')).collect()
[Row(c='10'), Row(c='101')]