Jan-23-2020, 01:14 AM
Hey all!!
I am having so much trouble with running a code for my project in Statistics.
My teacher referred me to this site, seems like he doesn't know whats going on either. I am extremely frustrated!
I am using Codio for Python and the project is about compiling data for two basketball teams. I need to run codes to get the mean, median, variance, standard deviation.
The codio gives us step by step of what to do, having most of the codes prefilled, just leaving out some things. When i run the code it says "name is not defined" and its silly because it doesn't say in the steps to even touch that portion of the code. I dont know what to do i am ready to pull my hair out. Is there a way someone could message me or email me please please please!
I understand statistics, but python is a whole foreign language for me and I dont get why the class would be mostly on python when the teach doesn't seem to understand :(
-------------------------------------------
Here are the only steps it wants us to do:
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.
-------------------------------------------
Here is the steps I put into the mostly prefilled code:
print("Your Team's Relative Skill in 2013 to 2015")
print("-------------------------------------------------------")
# ---- TODO: make your edits here ----
mean = you_team_df['elo_n'].mean()
median = your_team_df['elo_n'].median()
variance = your_team_df['elo_n'].variance()
stdeviation = your_team_df['elo_n'].stdev()
print('Mean =', round(mean,2))
print('Median =', round(median,2))
print('Variance =', round(variance,2))
print('Standard Deviation =', round(stdeviation,2))
--------------------------
Here is the error I continue to get:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-15-b7e20510d8d4> in <module>
3
4 # ---- TODO: make your edits here ----
----> 5 mean = you_team_df['elo_n'].mean()
6 median = your_team_df['elo_n'].median()
7 variance = your_team_df['elo_n'].variance()
NameError: name 'you_team_df' is not defined
I am having so much trouble with running a code for my project in Statistics.
My teacher referred me to this site, seems like he doesn't know whats going on either. I am extremely frustrated!
I am using Codio for Python and the project is about compiling data for two basketball teams. I need to run codes to get the mean, median, variance, standard deviation.
The codio gives us step by step of what to do, having most of the codes prefilled, just leaving out some things. When i run the code it says "name is not defined" and its silly because it doesn't say in the steps to even touch that portion of the code. I dont know what to do i am ready to pull my hair out. Is there a way someone could message me or email me please please please!
I understand statistics, but python is a whole foreign language for me and I dont get why the class would be mostly on python when the teach doesn't seem to understand :(
-------------------------------------------
Here are the only steps it wants us to do:
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.
-------------------------------------------
Here is the steps I put into the mostly prefilled code:
print("Your Team's Relative Skill in 2013 to 2015")
print("-------------------------------------------------------")
# ---- TODO: make your edits here ----
mean = you_team_df['elo_n'].mean()
median = your_team_df['elo_n'].median()
variance = your_team_df['elo_n'].variance()
stdeviation = your_team_df['elo_n'].stdev()
print('Mean =', round(mean,2))
print('Median =', round(median,2))
print('Variance =', round(variance,2))
print('Standard Deviation =', round(stdeviation,2))
--------------------------
Here is the error I continue to get:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-15-b7e20510d8d4> in <module>
3
4 # ---- TODO: make your edits here ----
----> 5 mean = you_team_df['elo_n'].mean()
6 median = your_team_df['elo_n'].median()
7 variance = your_team_df['elo_n'].variance()
NameError: name 'you_team_df' is not defined