Trainvalidationsplit Pyspark, I used the following code for the same: def data_split(x): global data_map_var.