Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dropna and freqdrop added and tested
- Loading branch information
ShayPalachy
committed
Jan 14, 2018
1 parent
8e96df4
commit c989520
Showing
6 changed files
with
127 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Testing basic pipeline stages.""" | ||
|
||
import pandas as pd | ||
|
||
from pdpipe.basic_stages import DropNa | ||
|
||
|
||
DF1 = pd.DataFrame([[1, 4], [4, None], [1, 11]], [1, 2, 3], ['a', 'b']) | ||
|
||
|
||
def test_dropna_basic(): | ||
"""Testing the DropNa pipeline stage.""" | ||
res_df = DropNa().apply(DF1) | ||
assert 1 in res_df.index | ||
assert 2 not in res_df.index | ||
assert 3 in res_df.index | ||
|
||
|
||
def test_dropna_verbose(): | ||
"""Testing the DropNa pipeline stage.""" | ||
res_df = DropNa().apply(DF1, verbose=True) | ||
assert 1 in res_df.index | ||
assert 2 not in res_df.index | ||
assert 3 in res_df.index |
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,24 @@ | ||
"""Testing basic pipeline stages.""" | ||
|
||
import pandas as pd | ||
|
||
from pdpipe.basic_stages import FreqDrop | ||
|
||
|
||
DF1 = pd.DataFrame([[1, 4], [4, 5], [1, 11]], [1, 2, 3], ['a', 'b']) | ||
|
||
|
||
def test_freqdrop_basic(): | ||
"""Testing the FreqDrop pipeline stage.""" | ||
res_df = FreqDrop(2, 'a').apply(DF1) | ||
assert 1 in res_df.index | ||
assert 2 not in res_df.index | ||
assert 3 in res_df.index | ||
|
||
|
||
def test_freqdrop_verbose(): | ||
"""Testing the FreqDrop pipeline stage.""" | ||
res_df = FreqDrop(2, 'a').apply(DF1, verbose=True) | ||
assert 1 in res_df.index | ||
assert 2 not in res_df.index | ||
assert 3 in res_df.index |
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