I have an ndarray of centroids (k means algorithm) and I want to create a to string for it that turns the ndarray into a string of specific format (shown below) is there an elegant way to do it?
I've tried to play a bit with python's join and split but couldn't quite get the result I wanted.
I wish to turn this:
[[0.7240662 0.64965678 0.55572689]
[0.50786521 0.43429734 0.35474341]
[0.04124227 0.03325809 0.04185308]
[0.19986216 0.17889411 0.17727035]]
Into this:
"[0.72, 0.64, 0.55], [0.50, 0.43, 0.35], [0.04, 0.03, 0.04], [0.19,0.17,0.17]"