pyspark.sql.functions.initcap

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

Translate the first letter of each word to upper case in the sentence.

New in version 1.5.0.

Examples

>>> spark.createDataFrame([('ab cd',)], ['a']).select(initcap("a").alias('v')).collect()
[Row(v='Ab Cd')]