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