MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   在numpy数组中找到相同值的序列的长度(游程长度编码) (https://www.labfans.com/bbs/showthread.php?t=22715)

poster 2019-12-10 16:49

在numpy数组中找到相同值的序列的长度(游程长度编码)
 
在pylab程序中(也可能是matlab程序),我有一个代表距离的数字的numpy数组: d[t]是时间t的[I]距离[/I] (我的数据的时间跨度是len(d)时间单位) 。


我感兴趣的事件是距离小于某个阈值时,并且我想计算这些事件的持续时间。可以很容易地得到b = d 0) run_ends, = numpy.where(difs < 0) return run_ends - run_starts 再说一遍:请确保在为您量身定制的示例中相互比较基准解决方案!



[url=https://stackoverflow.com/questions/1066758]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:28

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.