Open mattiasoldani opened 2 months ago
Better:
def rebin(x0, y0, nBin):
x, y = np.empty(0), np.empty(0)
for i in range(0, int(np.floor(len(x0)/nBin))*nBin, nBin):
x = np.append(x, sum(x0[i:(i+nBin)])/nBin)
y = np.append(y, sum(y0[i:(i+nBin)]))
return x, y
Starting point: