<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <H1>Moments of a distribution</H1>
Are quantitative measurements of the shape of a distribution. The n-th moment of the probability density function f(x) about the value c is
Step1:  <H2>1.- Mean</H2>
Where is the distrubtion centered.
Step2:  <H2>2.- Variance</H2>
What is the weight of the distribution.
Step3:  <H2>3.- Skew</H2>
How lopsided is the distribution. A distribution with a long tail on the left or to the right is skew.
Step4:  <H2>4.- Kurtosis</H2>
It is how thick is the tail and how sharp is the peak
Step5:  <H2>Percentile</H2>
A percentile is the percent of cases occurring at or below a score. The 25% percentile is also called Q1 and refers to the value at which 25% of observations are bellow a score. Q3  is the 75% percentile, and the median (or Q2) is the 50% percentile. The interquartile range (IQR) is the difference between Q3 and Q1, and it contains 50% of all observations. In box plots, whisker can be ploted as the most distal point that contains 1.5 times the IQR (Tukey style).
<ul>
  <li>Q1 = 1st quartile = 25th percentile</li>
  <li>Q2 = 2nd quartile = 50th percentile</li>
  <li>Q3 = 3rd quartile = 75th percentile</li>
  <li>Q4 = 4th quartile = 100th percent</li>
</ul>
<ASSISTANT_TASK:>
Python Code:
%pylab inline
import scipy.stats as stats
mu, sigma = 0.0, 1.0
data = np.random.normal(mu, sigma, 10000)
plt.hist(data, normed=1,bins=20, facecolor='yellow', alpha=.5);
xval = np.linspace(-4, 4, 100)
rv = stats.norm(mu, sigma)
plt.plot(xval,rv.pdf(xval), color='#AA0000')
plt.ylabel('Probability'), plt.xlabel('Value');
Explanation: <H1>Moments of a distribution</H1>
Are quantitative measurements of the shape of a distribution. The n-th moment of the probability density function f(x) about the value c is:
$$\mu_n=\int_{-\infty}^\infty (x - c)^n\,f(x)\,dx.$$
End of explanation
np.mean(data)
Explanation: <H2>1.- Mean</H2>
Where is the distrubtion centered.
End of explanation
np.var(data)
Explanation: <H2>2.- Variance</H2>
What is the weight of the distribution.
End of explanation
stats.skew(data)
Explanation: <H2>3.- Skew</H2>
How lopsided is the distribution. A distribution with a long tail on the left or to the right is skew.
End of explanation
stats.kurtosis(data)
Explanation: <H2>4.- Kurtosis</H2>
It is how thick is the tail and how sharp is the peak
End of explanation
Q2 = np.percentile(data, 50) # median
print(Q2, np.median(data))
Q1, Q3 = np.percentile(data, 25), np.percentile(data,75)
IQR = Q3-Q1
print(IQR)
Explanation: <H2>Percentile</H2>
A percentile is the percent of cases occurring at or below a score. The 25% percentile is also called Q1 and refers to the value at which 25% of observations are bellow a score. Q3  is the 75% percentile, and the median (or Q2) is the 50% percentile. The interquartile range (IQR) is the difference between Q3 and Q1, and it contains 50% of all observations. In box plots, whisker can be ploted as the most distal point that contains 1.5 times the IQR (Tukey style).
<ul>
  <li>Q1 = 1st quartile = 25th percentile</li>
  <li>Q2 = 2nd quartile = 50th percentile</li>
  <li>Q3 = 3rd quartile = 75th percentile</li>
  <li>Q4 = 4th quartile = 100th percent</li>
</ul>
End of explanation
<END_TASK>