🌈 搜索
📅  最后修改于: 2022-03-11 14:46:41.594000             🧑  作者: Mango
import numpy as np c = [1, 0, 0, 0, 0, 2, 0, 0, 0, 0] np.add.reduceat(c, np.arange(0, len(c), 5)) # array([1, 2])