Issue
how can i convert this Rdd to a list:
tfidf.collect()
output:
[DenseVector([0.0619]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.0619]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.031])]
And i need to make this Rdd to a similar list as this:
tfidf_list= [
DenseVector([0.0619]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.0619]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.031]),
DenseVector([0.031])
]
thanks for your help.
Solution
Use this:
tfidf_list = tfidf.collect()
Answered By - Abhyuday Vaish
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.