Add utils.pipe().
This commit is contained in:
parent
1b49500227
commit
bd2a206940
1 changed files with 6 additions and 0 deletions
|
|
@ -63,3 +63,9 @@ def neighbourhood(lst, index, window=5):
|
|||
before = lst[:index]
|
||||
after = lst[index + 1:]
|
||||
return before[-window:] + after[:window]
|
||||
|
||||
|
||||
def pipe(value, *funcs):
|
||||
for func in funcs:
|
||||
value = func(value)
|
||||
return value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue