我有一个类似于np.arange(100000)的东西,并且我需要多次检索两个索引之间的数据。目前我正在运行这个程序,运行速度很慢# This array usually contains thousands of slices [1, 4], [100,110],])
np.take(data, [i for iin, iout in
我的问题类似于:subsampling every nth entry in a numpy array 假设我有一个数组,如下所示:A=1,2,2,3,4,1,2,2,3,4,1,2,2,3,4,1,2,2,3,4…… 如何扩展切片,以便以特定的间隔对三个元素进行切片?也就是说,我如何从数组中切分2?我认为基本的切片在这种情况下不起作用。