I am working with a Polars DataFrame that contains a column with values like this:
shape: (3, 2)┌──────────────┬──────────────┐│ A │ B ││ --- │ --- ││ str │ str │├──────────────┼──────────────┤│ A|B:0d:cs │ C:2ew2 │├──────────────┼──────────────┤│ A:1ds0 │ E|F:91we23 │├──────────────┼──────────────┤│ QW|P:3dwsd │ A|Z:12w219 │└──────────────┴──────────────┘I want to extract the left substring from each cell in the DataFrame until I find the character ":". The desired result should look like this:
shape: (3, 2)┌──────────────┬──────────────┐│ A │ B ││ --- │ --- ││ str │ str │├──────────────┼──────────────┤│ A|B │ C │├──────────────┼──────────────┤│ A │ E|F │├──────────────┼──────────────┤│ QW|P │ A|Z │└──────────────┴──────────────┘Thank you for your help in advance!