I\'m looking for a way to get the last character from a string in a dataframe column and place it into another column.
I have a Spark dataframe that looks like this:
Just use the substring function
from pyspark.sql.functions import substring df.withColumn("b", substring(col("columnName"), -1, 1))