-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support of itrable q argument for move_quantile
- Loading branch information
1 parent
72677f8
commit 2c892db
Showing
3 changed files
with
21 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from ..move import move_quantile as move_quantile_c | ||
from collections.abc import Iterable | ||
import numpy as np | ||
|
||
def move_quantile(a, window, q, min_count=None, axis=-1): | ||
if not isinstance(q, Iterable): | ||
return move_quantile_c(a, window=window, min_count=min_count, axis=axis, q=q) | ||
result = np.asarray( | ||
[move_quantile_c(a=a, window=window, min_count=min_count, axis=axis, q=quantile) for quantile in q] | ||
) | ||
return result | ||
|
||
move_quantile.__doc__ = move_quantile_c.__doc__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters