我有以下代码:
ttmbond = 10
daywalk = np.arange(0,30)
dtm = ttmbond - daywalk/252
curve_list = [0.083,0.25,0.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
pos1= np.ones((len(daywalk+1),len(curve_list)))
pos2 = pos1*curve_list
pos3 = pos2 <= dtm
这给了我这个 TRUE/FALSE ndarray 我想得到每列中最后一个真值的行索引列表。从这个例子中,我的最终结果应该是[12,11,11,11,11,…]
或者,是否可以从曲线列表中获取值的位置,该列表是dtm中值的最大值,小于或等于该值
谢谢
扩展代码:
另一方面:
相关问题 更多 >
编程相关推荐