Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

create new column with first character of string pyspark

df = df.withColumn("first_n_char", df.colname.substr(1))
Source by www.datasciencemadesimple.com #
 
PREVIOUS NEXT
Tagged: #create #column #character #string #pyspark
ADD COMMENT
Topic
Name
9+7 =