After creating a Spark DataFrame from a CSV file, I would like to trim a column. I've tried:
df = df.withColumn("Product", df.Product.strip())
df
is my data frame, Product
is a column in my table
But I get the error:
Column object is not callable
Any suggestions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…