How to convert
array([DenseVector([5,2]),DenseVector([4,3])])
to
array([5,2],[4,3])
in python
Which package are you using to obtain DenseVector
?
Is it Spark ? If yes, according to the documentation , DenseVector
has a toArray()
method that returns the underlying np.ndarray
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.