I have this Dataframe
+----+----+------+------+------+----+
|key1|key2| col1| col2| col3|col4|
+----+----+------+------+------+----+
| 5| d|value7|value8|value9| 20|
+----+----+------+------+------+----+
And I am trying to do something like this
df2.withColumn("new",repeat(lit("0"), 10-length(col("col3")) )).show()
But I get this error message TypeError: Column is not iterable
I would like to know if there is any way to do a subtraction or maybe an addition using "length("col3")"