Reputation: 39
I want delete all numeric number in columns ,
Exemple :
I want a code with python. I talk about all columns and not only one row.
Using Excel file .xlsx
Column A for example
Upvotes: 1
Views: 56
Reputation: 15478
Try this for entire dataframe:
df = df.replace(to_replace=r'\d+', value='', regex=True)
For only one column:
df['COLUMN'] = df['COLUMN'].str.replace('\d+', '')
Upvotes: 2
Reputation: 323226
Try with replace
l=['ABC *12547 NDFRE12',
'12aRE 15P -> aRE P']
s = pd.Series(l)
0 ABC *12547 NDFRE12
1 12aRE 15P -> aRE P
s = s.str.replace('\d+','')
0 ABC * NDFRE
1 aRE P -> aRE P
dtype: object
Upvotes: 1