I have following dataframe
col1 col2
B20.0 B20 | B20-B20
B20.0 B20
A16 A15-A20
I would like to filter the rows such that for the same 'col1' value if col2 has a single value (without '|') choose this row otherwise chose another row. Should regex work here or a better approach work here.
The expected output is:
col1 col2
B20.0 B20
A16 A15-A20