Intro to Pandas for Data Analysis

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.

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

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

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

Calculate "Field Goals per Game" using the series `field_goals`

and `games_played`

. Store your results in the variable `field_goals_per_game`

multiplechoice

All stars here...

codevalidated

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 that, according to our dataset, has scored the most points in the NBA history?

codevalidated

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

codevalidated

Store your results in `ft_perc`

.

multiplechoice

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

codevalidated

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

Answer using the previously calcualted series `ft_top_25`

.

codevalidated

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

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

This project is part of

Explore other projects