code: def to_data_frame(sc, features, labels, categorical=False):
      """Convert numpy arrays of features and labels into Spark DataFrame"""
      lp_rdd = to_labeled_point(sc, features, labels, categorical)
      sql_context = SQLContext(sc)
      df = sql_context.createDataFrame(lp_rdd)
      return df
  
imports: from pyspark.sql import SQLContext
  from pyspark.mllib.regression import LabeledPoint
  from ..utils.rdd_utils import from_labeled_point, to_labeled_point, lp_to_simple_rdd
  from pyspark.mllib.linalg import Vector, Vectors
label_desc: Use image node_id 1 for calling a global function with example usage: to_data_frame(sc, features, labels, categorical) and returns: df