My df
has 2 columns:
Name Attr
a(bc)
b(aca)
(cba)
I would like the column Attr
to have the values within parentheses of column Name
Name Attr
a(bc) bc
b(aca) aca
(cba) cba
I tried:
df['Attr'] = re.findall('\(.*?\)',df['Name'].astype('str'))
TypeError: expected string or buffer
Really appreciate any help