I have an Ibis table where I’m trying to collapse transitive matches between pairs that match. For example, if I have a table that looks like
| group | A_match | B_match | C_match | D_match | E_match |
|——-|———|———|———|———|———|
| 1 | 1 | 1 | | | |
| 1 | | | 1 | 1 | |
| 1 | | | | | 1 |
I want it to still look like that after collapsing. But let’s say I have a table that looks like
group | A_match | B_match | C_match | D_match | E_match |
---|---|---|---|---|---|
1 | 1 | 1 | |||
1 | 1 | 1 | |||
1 | 1 | 1 | |||
1 | 1 |
Then I want it to look like this after collapsed
| group | A_match | B_match | C_match | D_match | E_match |
|——-|———|———|———|———|———|
| 1 | 1 | 1 | 1 | 1 | |
| 1 | | | | | 1 |
How can I do this purely in Ibis? I don’t want to convert anything to Pandas. Is there a way to use aggregation or something?