Встроенный
Изготовить копию
df.assign(**dict(zip('xywh', df.rect.str.findall('\d+').str)))
rect x y w h
0 <Rect (120,168),260 by 120> 120 168 260 120
1 <Rect (120,168),260 by 120> 120 168 260 120
2 <Rect (120,168),260 by 120> 120 168 260 120
3 <Rect (120,168),260 by 120> 120 168 260 120
4 <Rect (120,168),260 by 120> 120 168 260 120
Или просто переназначить на df
df = df.assign(**dict(zip('xywh', df.rect.str.findall('\d+').str)))
df
rect x y w h
0 <Rect (120,168),260 by 120> 120 168 260 120
1 <Rect (120,168),260 by 120> 120 168 260 120
2 <Rect (120,168),260 by 120> 120 168 260 120
3 <Rect (120,168),260 by 120> 120 168 260 120
4 <Rect (120,168),260 by 120> 120 168 260 120
Inplace
Изменить существующие df
df[[*'xywh']] = pd.DataFrame(df.rect.str.findall('\d+').tolist())
df
rect x y w h
0 <Rect (120,168),260 by 120> 120 168 260 120
1 <Rect (120,168),260 by 120> 120 168 260 120
2 <Rect (120,168),260 by 120> 120 168 260 120
3 <Rect (120,168),260 by 120> 120 168 260 120
4 <Rect (120,168),260 by 120> 120 168 260 120