The 6 AI Engineering Patterns, come build with Greg live:Β Starts Jan 6th, 2025
Leverage
Pandas functions

Multiply Columns To Make New Column Pandas

Multiply columns in Pandas

Multiplying columns together is a foundational skill in Pandas and a great one to master. Good thing it is straightforward and easy to pick up.

1. df['your_new_column'] = df['col1'] * df['col2']

In the video below we’ll review two methods for multiplying columns together and saving the result on your dataframe.

Code from the video. Looks like the formatting of many columns is very off. To view a nice version, head over to the git hub link below.

Link to code

On this page

No Headings