I'm trying to remove brackets with integers only from a df column. If it's an object than I'm hoping to keep it. Using below, there are certain rows that have two brackets. I only want to remove brackets that are all integers.
df = pd.DataFrame({
'col': ['Bear (123)', 'Dog (No 2a) (1502)', 'Cat Dog (No 7b) (16772)', 'Bear (123)']})
df['col'] = df['col'].str.replace(r"\(.*\)","")
intended out:
col
0 Bear
1 Dog (No 2a)
2 Cat Dog (No 7b)
3 Bear