As I understand your question (and since none of the previous answers are marked as accepted), it seems to me that you are trying to apply the transformation using two different columns of the same SFrame , therefore:
As indicated in the online documentation , the function that you pass to the SFrame.apply method will be called for each line in the SFrame.
Therefore, you must rewrite your function to get one argument representing the current line, as shown below:
def f(row): return row['column_1'] + row['column_2'] sf['new_col'] = sf.apply(f)
Elias oughghir
source share