code: def to_vector(np_array):
      """Convert numpy array to MLlib Vector"""
      if len(np_array.shape) == 1:
          return Vectors.dense(np_array)
      else:
          raise Exception(
              "An MLLib Vector can only be created from a one-dimensional "
              + "numpy array, got {}".format(len(np_array.shape))
          )
  
imports: from pyspark.mllib.linalg import Matrices, Vectors
label_desc: Use image node_id 4 for calling a global function with example usage: to_vector(np_array) and returns: Vectors