Query.jl - how to select identical rows differing by one column

This should do it:

df |>
  @groupby({_.A,_.B,_.C}) |>
  @filter(length(_)>1) |> 
  @mapmany(_, (i,j)->j) |>
  DataFrame

First we group things, then we filter out the groups that have only one element, then we unpack the groups again to go back to a table.

I think I should really add a more convenient way to ungroup tables… @mapmany(_, (i,j)->j) does work, but is a bit unwieldy and hard to remember…

2 Likes