Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to remove numbers from string in python pandas

import pandas as pd

# Example DataFrame
df = pd.DataFrame.from_dict({'Name'  : ['May21', 'James', 'Adi22', 'Hello', 'Girl90'],
                             'Volume': [23, 12, 11, 34, 56],
                             'Value' : [21321, 12311, 4435, 32454, 654654]})

df['Name'] = df['Name'].str.replace('d+', '')

print(df)
Comment

how to remove numbers from string in python dataframe

df['Column_Name'] = df['Column_Name'].str.replace('d+', '')
Comment

PREVIOUS NEXT
Code Example
Python :: install multiprocessing python3 
Python :: numpy to csv 
Python :: keras model load 
Python :: how to import csv in pandas 
Python :: python pie chart 
Python :: ls.ProgrammingError: permission denied for table django_migrations 
Python :: pandas dataframe set datetime index 
Python :: matplotlib y axis log scale 
Python :: discord.py add role on member join 
Python :: how to delete na values in a dataframe 
Python :: pandas empty dataframe with column names 
Python :: python get how many days in current month 
Python :: discord.py make command admin only 
Python :: numpy compare arrays 
Python :: image in cv2 
Python :: pretty print pandas dataframe 
Python :: pg double slider 
Python :: discord.py clear command 
Python :: SettingWithCopyWarning 
Python :: supprimer fichier pythpn 
Python :: how to get the current position of mouse on screen using python 
Python :: python add 1 to count 
Python :: python how to get number of strings in a list 
Python :: open choose files from file explorer python 
Python :: how to plot roc curve in python 
Python :: pandas count specific value in column 
Python :: correlation matrix python 
Python :: python datetime module print 12 hour clock 
Python :: matplotlib insert text 
Python :: plot model 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =