1 2 3 4 5 6
def run(data, vars): ret = data[0] for var in vars: ret[var['name']] = ret[var['field']].diff(var['by']) return ret