I would like a simple mehtod to delete parts of a string after a specified character inside a dataframe. Here is a simplified example:
df:
obs a b c d
0 1 1-23-12 1 2 3
1 2 12-23-13 4 5 5
2 3 21-23-14 4 5 5
I would like to remove the parts in the a column after the first - sign, my expected output is:
newdf:
obs a b c d
0 1 1 1 2 3
1 2 12 4 5 5
2 3 21 4 5 5