pyspark.sql.functions.char#
- pyspark.sql.functions.char(col)[source]#
Returns the ASCII character having the binary equivalent to col. If col is larger than 256 the result is equivalent to char(col % 256)
New in version 3.5.0.
- Parameters
- col
Column
or str Input column or strings.
- col
Examples
>>> import pyspark.sql.functions as sf >>> spark.range(1).select(sf.char(sf.lit(65))).show() +--------+ |char(65)| +--------+ | A| +--------+