Skip to content

Issue with the "# Get the product with the highest profit" section #1

Open
@MichaelCervoni

Description

@MichaelCervoni

Hi Derek,
Really like your videos! I think I noticed an error in this one.

for the line:
# Get the product with the highest profit
cs_df[['Profit','Product ID']].max(axis=0)

I think this is actually returning the max of each row, not the product with the highest profit. If you look at the product ID of the system with the highest output the answer should actually be GT13-0024.The profit of the answer Q526FA is only 143.09.

A way I found to get the correct answer is
cs_df[cs_df['Profit'] == cs_df['Profit'].max()][['Profit','Product ID']]
Again thanks for the videos, they are really helpfull!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions