|
1 | 1 | from typing import Optional |
2 | 2 |
|
3 | 3 | import pandas as pd |
4 | | -from comparators.Comparator import Comparator |
5 | 4 |
|
| 5 | +from comparators.Comparator import Comparator |
6 | 6 | from comparison_tools.PairwiseCompare import PairwiseCompare |
7 | 7 |
|
8 | 8 |
|
@@ -61,27 +61,22 @@ def __init__( |
61 | 61 | self._comparator = _comparator |
62 | 62 |
|
63 | 63 | if len(_different_columns) >= 2 and not _same_columns: |
64 | | - pairwise_compare_obj = PairwiseCompare( |
65 | | - _df=_df, |
66 | | - _comparator=_comparator, |
67 | | - _antehoc_group_cols=_different_columns[:1], |
68 | | - _posthoc_group_cols=_different_columns[1:], |
69 | | - _feat_cols=_feat_cols, |
70 | | - _drop_cols=_drop_cols, |
71 | | - ) |
| 64 | + _same_columns = _different_columns[:1].copy() |
| 65 | + _different_columns = _different_columns[1:] |
| 66 | + |
| 67 | + pairwise_compare_obj = PairwiseCompare( |
| 68 | + _df=_df, |
| 69 | + _comparator=_comparator, |
| 70 | + _antehoc_group_cols=_same_columns, |
| 71 | + _posthoc_group_cols=_different_columns, |
| 72 | + _feat_cols=_feat_cols, |
| 73 | + _drop_cols=_drop_cols, |
| 74 | + ) |
72 | 75 |
|
| 76 | + if len(_different_columns) >= 2 and not _same_columns: |
73 | 77 | pairwise_compare_obj.inter_comparisons() |
74 | 78 |
|
75 | 79 | elif len(_different_columns) >= 1 and len(_same_columns) >= 1: |
76 | | - pairwise_compare_obj = PairwiseCompare( |
77 | | - _df=_df, |
78 | | - _comparator=_comparator, |
79 | | - _antehoc_group_cols=_same_columns, |
80 | | - _posthoc_group_cols=_different_columns, |
81 | | - _feat_cols=_feat_cols, |
82 | | - _drop_cols=_drop_cols, |
83 | | - ) |
84 | | - |
85 | 80 | pairwise_compare_obj.intra_comparisons() |
86 | 81 |
|
87 | 82 | def __call__(self): |
|
0 commit comments