0

I am trying to add a prefix to a string column 'data' value with:

`df.select('data_id',lpad(df['data'],length(df.data) +3 ,'p1/'))`

But I got this error:

TypeError: 'Column' object is not callable

I tried casting with int(length(df.data)), but the message was

TypeError: int() argument must be a string or a number, not 'Column'

I also tried .cast("integer") and I got a similar error.

Additionally, I need to add the prefix just under a condition where 'data_id' is under an interval, like [1 .. 100]. Can you help me?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Stefani
  • 1
  • 1

0 Answers0