pyspark.sql.functions.bin

pyspark.sql.functions.bin(col: ColumnOrName) → pyspark.sql.column.Column

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

Examples

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