Below is a sample of my df
id name
01 1
02 23 2
03 234
04 23423
05 24 H AUTOSERVICE
06 25 SUNGLASS
The aim is to 'clean' the DF by replacing digits with NaN only if the whole value contains digits.
The expected output would look like this
id name
01 NaN
02 24 H AUTOSERVICE
03 25 SUNGLASS
I was thinking about something like this. Besides, it would remove all digits even 24 H
df['name'] = df['name'].replace(r'[0-9]', '')
Thanks for anyone helping!