code: def from_data_frame(df, categorical=False, nb_classes=None):
      
      lp_rdd = df.rdd.map(lambda row: LabeledPoint(row.label, row.features))
      features, labels = from_labeled_point(lp_rdd, categorical, nb_classes)
      return features, labels
docs: Convert DataFrame back to pair of numpy arrays