Reputation: 13
Here is a data frame I wanted same output.
Please tell me how should I write a python code to solve question...
DF
A B C
1 1 2 3
2 1 3 5
3 1 1 1
And I need A output like
Answer:
Multiplication
1 6
2 15
3 1
Upvotes: 0
Views: 68
Reputation: 42886
Use DataFrame.prod
over axis=1
df.prod(axis=1)
1 6
2 15
3 1
dtype: int64
Upvotes: 3