TD bincount
2 years ago in Python
import numpy as np
def onSetupParameters(scriptOp):
return
# called whenever custom pulse parameter is pushed
def onPulse(par):
return
def onCook(so):
so.clear()
arr = np.fromstring(so.inputs[0].text, dtype=int, sep='\n')
count_arr = np.bincount(arr)
for i, v in enumerate(count_arr):
so.appendRow([str(i), v])
return