I have read textFile using spark context, test file is a csv file. Below testRdd is the similar format as my rdd.
testRdd = [[1.0,2.0,3.0,4.0,5.0,6.0,7.0],
[0.0,0.1,0.3,0.4,0.5,0.6,0.7],[1.1,1.2,1.3,1.4,1.5,1.6,1.7]]
I want to convert the the above rdd into a numpy array, So I can feed the numpy array into my machine learning model.
when I tried the following
feature_vector = numpy.array(testRDD).astype(numpy.float32)
It gives me the below TypeError:
TypeError: float() argument must be a string or a number
How Should I covert the spark rdd into a numpy array.