Series Practice: Vectorized Operations using NBA data
Series Practice: Vectorized Operations using NBA data Data Science Project
Intro to Pandas for Data Analysis

Series Practice: Vectorized Operations using NBA data

In this project you'll be tasked with constructing different vectorized operations to transform data stored in Pandas series by applying different types of vectorized operations using a Dataset containing NBA Player stats.
Start this project
Series Practice: Vectorized Operations using NBA dataSeries Practice: Vectorized Operations using NBA data
Project Created by

Santiago Basulto

Project Activities

All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.

All our activities include solutions with explanations on how they work and why we chose them.

codevalidated

Field Goal %

Calculate the "Field Goal accuracy" of a player by dividing their field goals by their total attempts. Store the result in the variable field_goal_perc.

input

What's the FG% of Michael Jordan

Remember, MJ's name in this dataset is "Michael Jordan*" because he was (obviously) inducted in the HoF. Enter your result with up to three decimal points. That is, if the value is 0.618324, enter 0.618 (including the 0 and the dot .).

codevalidated

Field goals per Game

Calculate "Field Goals per Game" using the series field_goals and games_played. Store your results in the variable field_goals_per_game

multiplechoice

Which player has the highest 'Field Goal per Game' value?

All stars here...

codevalidated

Calculate 'Total Points'

In the NBA lingo, field goals account for all the "goals" scored by a player, EXCEPT free throws. So, if we want to calculate the total number of points scored by a player, we must add field goals and free throws. Field goals are a combination of 2-point and 3-point goals. For this exercise, you can safely assume that all "field goals" have a value of 2.

Calculate Total Points scored by a player, by adding the series containing field goals and free throws. Store your results in the variable total_points.

multiplechoice

Who's the player with the most Total Points?

Who's the player that, according to our dataset, has scored the most points in the NBA history?

codevalidated

Total Points per Minute

Using the series that you previously calculated, total_points, calculate "Total points per minute". Store your results in the variable points_per_minute.

Important. This activity relies on total_points. Make sure you have completed that one correctly.

multiplechoice

Who has a better Points per Minute score; MJ or Kevin Durant?

codevalidated

Calculate FT%

Store your results in ft_perc.

multiplechoice

Who's the player with best FT% record: MJ or Larry Bird?

A battle of titans. Who had a better FT% record?

codevalidated

Find the top 25% players by 'free throw accuracy'

Create a boolean series that contains True values for those players that are in the top 25% by free throw efficiency (using the preivously calculated) ft_perc series. Store your results in the variable ft_top_25.

Your result should look something like:

>>> ft_top_25.head(10)
Player
A.C. Green       False
A.J. Bramlett    False
A.J. English     False
A.J. Guyton       True
A.J. Hammons     False
A.J. Price       False
A.J. Wynder      False
Aaron Brooks      True
Aaron Gordon     False
Aaron Gray       False
dtype: bool
input

How many players are in the top 25% by free throw accuracy?

Answer using the previously calcualted series ft_top_25.

codevalidated

Find those players that scored `0` points in their history

Create a boolean series that contains True values for those players that have scored 0 total points. Store your results in the variable players_0_points.

input

How many players have scored 0 points?

Using your previous series, answer: how many players registered 0 points?

Series Practice: Vectorized Operations using NBA dataSeries Practice: Vectorized Operations using NBA data
Project Created by

Santiago Basulto

This project is part of

Intro to Pandas for Data Analysis

Explore other projects