-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix compress_memberships bug, add test
- Loading branch information
1 parent
bac68df
commit 79f1974
Showing
2 changed files
with
14 additions
and
2 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,12 @@ | ||
import pandas as pd | ||
|
||
from er_evaluation.data_structures import compress_memberships | ||
|
||
def test_keep_na_values_in_index(): | ||
series1 = pd.Series(index=[-1, 0, 4, 7], data=[pd.NA, 1, 2, 3]) | ||
series2 = pd.Series(index=[1, 0, 4, 8], data=[1, pd.NA, 2, 3]) | ||
cs1, cs2 = compress_memberships(series1, series2) | ||
|
||
assert cs1.isna().sum() == 3 | ||
assert cs2.isna().sum() == 3 | ||
|