刚接触python的菜鸟,请问为什么运算结果这么离谱啊,我就想将数组第二列减去同一个数。
部分原数据
[[ 44.77128601 14.04218197] [ 117.71398926 37.58509445] [ 119.91621399 38.46121597] [ 121.7646637 38.75228882] [ 130.83340454 14.55740738] [ 133.99794006 14.06195545]]
代码:
import numpy as np
np.set_printoptions(suppress=True)
for i in range(0,235):
resArray[i,1] -= 15.33813006
print(resArray)
输出结果:
[[ 44.77128601 -108.32472845] [ 117.71398926 -84.78181597] [ 119.91621399 -83.90569445] [ 121.7646637 -83.6146216 ] [ 130.83340454 -107.80950304] [ 133.99794006 -108.30495497]]