Multiplying two pandas,

74 views
Skip to first unread message

Lino Gabriel

unread,
Mar 7, 2018, 9:20:50 AM3/7/18
to PyData
I'm a new user of python, I would like to know what function I can use to so that I can multiply two pandas of the same dimensions, but each columns in df (A) to be multiplied by corresponding columns in df (B).



Kind Regards 

Paul Hobson

unread,
Mar 7, 2018, 9:40:12 AM3/7/18
to pyd...@googlegroups.com
With info you've provided, it's as simple as: df['A'] * df['B'] or df['A'].multiply(df['B']).

See the docs:

On Sat, Feb 24, 2018 at 12:14 AM, Lino Gabriel <lino...@gmail.com> wrote:
I'm a new user of python, I would like to know what function I can use to so that I can multiply two pandas of the same dimensions, but each columns in df (A) to be multiplied by corresponding columns in df (B).



Kind Regards 

--
You received this message because you are subscribed to the Google Groups "PyData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages