在一片ump子中触及以下两个价值观的最佳方式是什么?
例如:
npdata = np.array([13,15,20,25])
for i in range( len(npdata) ):
print npdata[i] - npdata[i+1]
this looks really messed up and additionally needs exception code for the last iteration of the loop. any ideas?
感谢!