📜  如何规范化一维 numpy 数组 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:47.137000             🧑  作者: Mango

代码示例1
# Foe 1d array
an_array = np.array([0.1,0.2,0.3,0.4,0.5])

norm = np.linalg.norm(an_array)
normal_array = an_array/norm
print(normal_array)

#[0.2,0.4,0.6,0.8,1] (Should be, I didin't run the code)