from pyspark.mllib.regression import LabeledPoint
feature_matrix_vectors = sc.parallelize([DenseVector([1.0, 31.0, 5.0, 
    1935.0, 24.0]), DenseVector([1.0, 1231.0, 15.0, 2008.0, None])])
feature_matrix_vectors.map(lambda v: LabeledPoint(1.0 if None in v else 0.0, v)
    ).collect()
Iterating through a Spark RDD