Reputation: 43
A = 49531.78, -3.178 ,-2.119
Want to divide A's value with 49939.203 , used formula in excel =IFERROR(49939.203/A1,0) B should be => 1.01;-15714.04; -23567.35 , how should I do in python to get this division ?
Upvotes: 1
Views: 376
Reputation: 862801
Use Series.rdiv
for divide from right side:
df['B'] = df.A.rdiv(49939.203).replace(np.inf, 0).round(2)
print (df)
A B
0 49531.780 1.01
1 -3.178 -15714.03
2 -2.119 -23567.34
3 0.000 0.00
Upvotes: 1