Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个这样的向量V = [0.5,0.6,0.2,0.8...],我想将每个元素映射到最接近的整数 0 或 1。
V = [0.5,0.6,0.2,0.8...]
这样做的功能或方法是什么?
round()正在这样做:) 很明显,我很傻!
round()