pyspark.sql.functions.lpad¶
-
pyspark.sql.functions.
lpad
(col: ColumnOrName, len: int, pad: str) → pyspark.sql.column.Column¶ Left-pad the string column to width len with pad.
Examples
>>> df = spark.createDataFrame([('abcd',)], ['s',]) >>> df.select(lpad(df.s, 6, '#').alias('s')).collect() [Row(s='##abcd')]