pyspark.sql.functions.bin

pyspark.sql.functions.bin(col: ColumnOrName) → pyspark.sql.column.Column[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')]