Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
Translate the first letter of each word to upper case in the sentence.
For the corresponding Databricks SQL function, see initcap function.
Syntax
from pyspark.sql import functions as dbf
dbf.initcap(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
target column to work on. |
Returns
pyspark.sql.Column: string with all first letters are uppercase in each word.
Examples
from pyspark.sql import functions as dbf
df = spark.createDataFrame([('ab cd',)], ['a'])
df.select("*", dbf.initcap("a")).show()