def decorator(func): def wrapper(*args, **kwargs): awayteam = kwargs.get('awayteam') df = func(hometeam=hometeam) return df[df['awayteam_name'] == awayteam] return wraps(func)(wrapper)
def decorator(func): def wrapper(*args, **kwargs): hometeam = kwargs.get('hometeam') awayteam = kwargs.get('awayteam') df = func(hometeam=hometeam, awayteam=awayteam) return df[((df['awayteam_name'] == awayteam) | (df['hometeam_name'] == hometeam))] return wraps(func)(wrapper)
def decorator(func): def wrapper(*args, **kwargs): top = kwargs.get('top', 20) df = func(args[0], top=top) df['count'] = 1 return df.iloc[:top].groupby([ 'score' ])['count'].sum().reset_index().sort_values(by=['count'], ascending=False) return wraps(func)(wrapper)
def update_event(self, inp=-1): self.set_output_val( 0, contextlib.wraps(self.input(0), self.input(1), self.input(2)))
def decorator(func): def wrapper(*args, **kwargs): df = func(*args, **kwargs) return df[(df['matchtime'] <= NOW)] return wraps(func)(wrapper)