码迷,mamicode.com
首页 > 其他好文 > 详细

Statistics and Linear Algebra 2

时间:2016-12-04 07:52:39      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:standard   linear   plot   show   eth   import   iat   plt   result   

1. The way to calculate the variance of a certain set of data:

  pts_mean = sum(nba_stats["pts"])/len(nba_stats[‘pts‘])
  point_variance = 0
  for i in nba_stats[‘pts‘]:
    difference = (i - pts_mean) ** 2
    point_variance += difference
  point_variance = point_variance / len(nba_stats[‘pts‘])

2. Something to the power has the highest pirority, then mutiply and devide, the add and subsract.

3. Raise 11 to the fifth power. Assign the result to e.(11**5)

  Take the fourth root of 10000. (10000**(1/4))

4. Use std() method to get the standard diviation:
  std_dev = nba_stats["pf"].std()

5. To get the normal distribution:

  from scipy.stats import norm

  points_two = np.arange(-10,10,0.1) #setup the x value by distributing from 100 points from -10 to 10 evenly.
  probabilities_two = norm.pdf(points_two,0,2) # get the normal distribution by using norm function 
  plt.plot(points,probabilities_two) # plot the points
  plt.show()

6. In the normal distribution:

  68% of the data is within 1 standard deviation of the mean, about 95% is within 2 standard deviations of the mean, and about 99% is   within 3 standard deviations of the mean

7.

 

Statistics and Linear Algebra 2

标签:standard   linear   plot   show   eth   import   iat   plt   result   

原文地址:http://www.cnblogs.com/kingoscar/p/6130189.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!