Answers for "pandas divide multiple columns by one column"

2

divide two columns pandas

#If you want to divide column_name1 by column_name2
df['new_column'] = df.column_name1.div(df.column_name2)
Posted by: Guest on August-06-2021
0

pandas divide multiple columns by one column

df[['B','C']].div(df.A, axis=0) and df.iloc[:,1:].div(df.A, axis=0)
Posted by: Guest on March-24-2022

Code answers related to "pandas divide multiple columns by one column"

Python Answers by Framework

Browse Popular Code Answers by Language