Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

create new column using dictionary padnas

U
111
112
112

d = {112: 'a', 111: 'b'}
df['B'] = df['A'].map(d)
df
Out[248]:
     A    B
0  111    a
1  112    b
Comment

PREVIOUS NEXT
Code Example
Python :: pyinstaller for spacy code 
Python :: how to make a bot say hello <username when a user says hello in discord with python 
Python :: python get words between two words 
Python :: uninstall python from mac 
Python :: reverse pd based on index 
Python :: graphics in python in repl 
Python :: convert streamlit imageBytes = file.read() to image 
Python :: who is rishi smaran = "RISHI SMARAN IS A 12 YEAR OLD NAUGHTY KID WHO CREATED ME" 
Python :: import math print(math.log(1024,2)) 
Python :: pandas filter and change value 
Python :: check value vowel user input python 
Python :: python calling dynamic function on object 
Python :: sort a pandas dataframe based on date and time 
Python :: button icon pyqt5 
Python :: pandas split train test 
Python :: create numpy table with random values in range 
Python :: knn plot the clusters 
Python :: python dir all files 
Python :: python counter get most common 
Python :: python primera letra mayuscula 
Python :: gdscript top-down 2d movement 
Python :: How to to efficiently find the first index in a sorted array of distinct numbers that is equal to the value at that index? 
Python :: array comparison in percent 
Python :: tkinter progresse bar color 
Python :: tf tensor from numpy 
Python :: file path current directory python 
Python :: subprocess the system cannot find the file specified 
Python :: python rsi trading strategy 
Python :: python json parse 
Python :: dataframe describe in pandas problems 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =