Skip to content

Commit

Permalink
Update functions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hujy committed Jul 31, 2015
1 parent 2cd43e5 commit 8b2506a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions python/pyspark/sql/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,9 @@ def length(col):
@since(1.5)
def initcap(col):
"""Translate the first letter of each word to upper case in the sentence.
>>> sqlContext.createDataFrame([('the test',)], ['a']).select(initcap('the test')\
.alias('v')).collect()
[Row(v='The Test')]
>>> sqlContext.createDataFrame([('a b',)], ['a']).select(initcap('a b').alias('v')).collect()
[Row(v='A B')]
"""
sc = SparkContext._active_spark_context
return Column(sc._jvm.functions.initcap(_to_java_column(col)))
Expand Down

0 comments on commit 8b2506a

Please sign in to comment.