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 :: python how to make something run once 
Python :: how to get a row from a dataframe in python 
Python :: selenium webdriver python 
Python :: https flask 
Python :: how to import data from csv to jupyter notebook 
Python :: what is wsgi in python 
Python :: python index of last occurrence in string 
Python :: python read from txt file 
Python :: how to slice dataframe based on daterange in pandas 
Python :: django filter text first character upper case 
Python :: WARNING: Ignoring invalid distribution -ip 
Python :: python get angle between two points 
Python :: iris dataset python import 
Python :: tkinter events 
Python :: how to convert tuple to int in python 
Python :: train,test,dev python 
Python :: how to get seconds from datetime in python 
Python :: django static url 
Python :: python join paths 
Python :: swapcase 
Python :: python insert object into list 
Python :: python counter least common 
Python :: filter dataframe 
Python :: python create list with n elements 
Python :: remove columns that contain certain names in pandas 
Python :: Django - include app urls 
Python :: python deque 
Python :: how to print hello world in python 
Python :: http.server python 
Python :: convert from 12 hrs to 24 python 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =