Reputation: 790
I have a vector such V = [0.5,0.6,0.2,0.8...] and I want to map each element to its nearest integer 0 or 1.
V = [0.5,0.6,0.2,0.8...]
What is the function or method to do so?
Upvotes: 0
Views: 159
round() is doing that :) is it obvious, silly me !
round()
Upvotes: 1