Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Team Leaders Table | Team Performance Analysis
Python for Coaches

Challenge: Team Leaders Table

Coaches often want to quickly identify team leaders in key statistics. Use pandas to automate this process.

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 5
single

single

Challenge: Team Leaders Table

Swipe to show menu

Coaches often want to quickly identify team leaders in key statistics. Use pandas to automate this process.

Task

Swipe to start coding

Write a function that takes a DataFrame with columns 'athlete', 'goals', and 'assists' and returns a new DataFrame containing only the athletes who have the highest number of goals or assists.

  • Find the maximum value in the 'goals' column.
  • Find the maximum value in the 'assists' column.
  • Select all rows where the value in 'goals' equals the maximum goals or the value in 'assists' equals the maximum assists.
  • Return a DataFrame with only these rows.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 5
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt