Question: Step 6: Descriptive Statistics: Points Scored By Your Time in Home Games The management of your team wants you to run descriptive statistics on the

Step 6: Descriptive Statistics: Points Scored By Your Time in Home Games The management of your team wants you to run descriptive statistics on the points scored by your team in the games played at your team's venue in 2013-2015. Calculate descriptive statistics including the mean, median, variance, and standard deviation for points scored by your team played at Home. Make the following edits to the code block below: Replace ??MEAN_FUNCTION?? with the name of Python function that calculates the mean. Replace ??MEDIAN_FUNCTION?? with the name of Python function that calculates the median. Replace ??VAR_FUNCTION?? with the name of Python function that calculates the variance. Replace ??STD_FUNCTION?? with the name of Python function that calculates the standard deviation. After you are done with your edits, click the block of code below and hit the Run button above.

print("Points Scored by Your Team in Home Games (2013 to 2015)")

print("-------------------------------------------------------")

# The dataframe for your team is called your_team_df

your_team_home_df = your_team_df[your_team_df['game_location']=='H'].copy()

# ---- TODO: make your edits here ----

mean = your_team_home_df['pts'].mean()

median = your_team_home_df['pts'].median()

variance = your_team_home_df['pts'].var()

stdeviation = your_team_home_df['pts'].std()

print('Mean =', round(mean,2))

print('Median =', round(median,2))

print('Variance =', round(variance,2))

print('Standard Deviation =', round(stdeviation,2))

Points Scored by Your Team in Home Games (2013 to 2015)

-------------------------------------------------------

---------------------------------------------------------------------------

NameError Traceback (most recent call last)

 in 

3

4 # The dataframe for your team is called your_team_df.

----> 5 your_team_home_df = your_team_df[your_team_df['game_location']=='H'].copy()

6

7 # ---- TODO: make your edits here ----

NameError: name 'your_team_df' is not defined

Can someone please help me understand why there is a NameError and how to solve this correctly in Python? Thankyou!!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!