Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas replace string with another string

df['prod_type'] = df['prod_type'].replace({'respon':'responsive', 'r':'responsive'})
Comment

str replace pandas

>>> pd.Series(['foo', 'fuz', np.nan]).str.replace('f.', 'ba', regex=True)
0    bao
1    baz
2    NaN
dtype: object
Comment

PREVIOUS NEXT
Code Example
Python :: global in python 
Python :: how to check encoding of csv 
Python :: cv2 imwrite 
Python :: how to make python 3 default on mac 
Python :: int to char python 
Python :: how to update values in tkinter 
Python :: range python 
Python :: driver find element with multiple classes python 
Python :: selenium undetected chromedriver error 
Python :: access class variable from another class python 
Python :: how to cut image python 
Python :: how to replace an element of a list using list comprehension 
Python :: how to make python into exe 
Python :: pygame.events 
Python :: all the symbols on a keyboard python list 
Python :: add values of two columns pandas 
Python :: Spotify API Authentication in Python 
Python :: pickle example 
Python :: count repeated strings map python 
Python :: Python write value in next row of existing .text file 
Python :: how to get the index of the first integer in a string python 
Python :: group by 2 columns pandas 
Python :: python sys.argv exception 
Python :: Python Frozenset() for Dictionary 
Python :: python sleep 
Python :: wav file to array python 
Python :: count number items in list python 
Python :: line plotly with shaded area 
Python :: python import file from different directory 
Python :: remove  python 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =