Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

divide two columns pandas

#If you want to divide column_name1 by column_name2
df['new_column'] = df.column_name1.div(df.column_name2)
 
PREVIOUS NEXT
Tagged: #divide #columns #pandas
ADD COMMENT
Topic
Name
3+6 =