-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV numpy prenan fn TST new numba file MAINT minor refactor BUG #690 …
…pivots
- Loading branch information
Showing
11 changed files
with
63 additions
and
36 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
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
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
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
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,34 @@ | ||
# -*- coding: utf-8 -*- | ||
import numpy as np | ||
import pandas_ta as ta | ||
|
||
from pytest import mark | ||
|
||
|
||
@mark.parametrize("array,n,result", [ | ||
(np.ones(5), 2, np.array([np.nan, 1.0, 1.0, 1.0, 1.0])), | ||
(np.ones(5), -2, np.ones(5)) | ||
]) | ||
def test_np_prenan(array, n, result): | ||
np.testing.assert_array_equal(ta.np_prenan(array, n), result) | ||
|
||
|
||
@mark.parametrize("array,n,result", [ | ||
(np.ones(5), 2, np.array([np.nan, np.nan, 1.0, 1.0, 1.0, 1.0, 1.0])), | ||
(np.ones(5), -2, np.ones(5)) | ||
]) | ||
def test_np_prepend(array, n, result): | ||
np.testing.assert_array_equal(ta.np_prepend(array, n), result) | ||
|
||
|
||
@mark.parametrize("array,n,fn,result", [(np.ones(5), 2, None, np.ones(5))]) | ||
def test_np_rolling(array, n, fn, result): | ||
np.testing.assert_array_equal(ta.np_rolling(array, n, fn), result) | ||
|
||
|
||
@mark.parametrize("array,n,result", [ | ||
(np.ones(5), 2, np.array([np.nan, np.nan, 1.0, 1.0, 1.0])), | ||
(np.ones(5), -2, np.array([1.0, 1.0, 1.0, np.nan, np.nan])) | ||
]) | ||
def test_np_shift(array, n, result): | ||
np.testing.assert_array_equal(ta.np_shift(array, n), result) |
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