Spark dataframe apply function to each row python