I have a numpy 2D array like so:
[['a', '(junk, b)', '(junk, c)'],
['d', '(junk, e)', '(junk, f)'],
['g', '(junk, h)', '(junk, i)']]
As you can see some of the values have a parenthesis around them, I'd like to remove these extra values such that my new array is:
[['a', 'b', 'c'],
['d', 'e', 'f'],
['g', 'h', 'i']]
I have a regex to get the match group of the data I want to capture but is there a clean way within numpy to apply a regex to certain values at certain positions and return my new array with the unwanted values replaced?