<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <center><font color=red>Learning SciPy for Numerical and Scientific Computing</font></center>
Content under Creative Commons Attribution license CC-BY 4.0, code under MIT license (c)2014 Sergio Rojas (srojas@usb.ve) and Erik A Christensen (erikcny@aol.com).
<b><font color='red'>     NOTE
Step1:  <b> <font color=red>What follows generates the <i> stem plot</i> mentioned in the text</font></b>
Step2:  <b> <font color=red>NOTE</font>
Step3:  <b> <font color=red>NOTE</font>
Step4:  How to find documentation
<ul>
General SciPy documentation is available at
Step5:  Scientific visualization
<ul>
General Matplotlib references
<ASSISTANT_TASK:>
Python Code:
import numpy
import scipy
scores=numpy.array([114, 100, 104, 89, 102, 91, 114, 114, 103, 105, 108, 130, 120, 132, 111, 128, 118, 119, 86, 
                    72, 111, 103, 74, 112, 107, 103, 98, 96, 112, 112, 93])
Explanation: <center><font color=red>Learning SciPy for Numerical and Scientific Computing</font></center>
Content under Creative Commons Attribution license CC-BY 4.0, code under MIT license (c)2014 Sergio Rojas (srojas@usb.ve) and Erik A Christensen (erikcny@aol.com).
<b><font color='red'>     NOTE: This IPython notebook should be read alonside the corresponding chapter in the book, where each piece of code is fully explained.     </font></b> <br>
<center>     CHAPTER 1: Introduction to SciPy </center>
CHAPTER SUMMARY
In this chapter we'll learn the benefits of using the combination of Python, NumPy, SciPy, and Matplotlib as a programming environment for any scientific endeavor that requires mathematics; in particular, anything related to numerical computations. We'll explore the environment, learn how to download and install the required libraries, use them for some quick computations, and figure out a few good ways to search for help.
What is SciPy?
A few links with documentation that can help to enhance the discussion presented on this section of the book are as follows:
<ul>
The Scipy main site:
<li>
  [http://www.scipy.org/](http://www.scipy.org/)
</li><br>
Scipy : high-level scientific computing
<li>
  [https://scipy-lectures.github.io/intro/scipy.html](https://scipy-lectures.github.io/intro/scipy.html)
</li><br>
Archives of the SciPy mailing discussion list 
<li>
  [http://mail.scipy.org/pipermail/scipy-user/](http://mail.scipy.org/pipermail/scipy-user/)
</li>
</ul>
How to install SciPy
<ul>
Installing the SciPy Stack and Scientific Python distributions:
<li>
  [http://www.scipy.org/install.html](http://www.scipy.org/install.html)
</li><br>
Building From Source on Linux:
<li>
   [http://www.scipy.org/scipylib/building/linux.html](http://www.scipy.org/scipylib/building/linux.html)
</li><br>
Unofficial Windows Binaries for Python Extension Packages:
<li>
  [http://www.lfd.uci.edu/~gohlke/pythonlibs/](http://www.lfd.uci.edu/~gohlke/pythonlibs/)
</li><br>
</ul>
SciPy organization
<ul>
An exhaustive list of SciPy modules is avalilable at:
<li>
  http://docs.scipy.org/doc/scipy/reference/py-modindex.html
</li><br>
</ul>
End of explanation
nbins = 6
sortedscores = numpy.sort(scores)
intervals = numpy.linspace(sortedscores[0],sortedscores[-1],nbins+1);
leftEdges = intervals[0:-1]; 
rightEdges = intervals[1:]; 
middleEdges = ( leftEdges + rightEdges ) / 2.0; 
j=0
temp=sortedscores[j]
count = numpy.zeros([nbins,1])
i=0
istop = len(leftEdges) - 1 
while j<len(sortedscores):
 while ( ((leftEdges[i] <= temp) & (temp < rightEdges[i])) ):
   count[i] = count[i]+1
   j=j+1
   temp = sortedscores[j]
 if i < istop:
   i=i+1
 else:
   j=j+1
if temp == rightEdges[i]:
  count[i] = count[i]+1
%matplotlib inline 
import matplotlib.pylab as plt
plt.stem(middleEdges, count)
plt.show()
Explanation: <b> <font color=red>What follows generates the <i> stem plot</i> mentioned in the text</font></b>
End of explanation
dir(scores)
xmean = scipy.mean(scores)
sigma = scipy.std(scores)
n = scipy.size(scores)
print ("({0:0.14f}, {1:0.15f}, {2:0.14f})".format(xmean, xmean - 2.576*sigma/scipy.sqrt(n), 
                                                  xmean + 2.576*sigma/scipy.sqrt(n) ))
from scipy import stats
result=scipy.stats.bayes_mvs(scores)
Explanation: <b> <font color=red>NOTE</font>: to shorten the output of the next command, click the leftmost mouse button on the left of the output to activate a scrolling window. Do the same to anyother help output which follows after this one </b>
End of explanation
help(scipy.stats.bayes_mvs)
print(result[0])
Explanation: <b> <font color=red>NOTE</font>: to shorten the output of the next command, click the leftmost mouse button on the left of the output to activate a scrolling window. Do the same to anyother help output which follows after this one </b>
End of explanation
help(scipy.stats.bayes_mvs)
numpy.info('random')
help(numpy.random)
help(scipy.stats)
help(scipy.stats.kurtosis)
Explanation: How to find documentation
<ul>
General SciPy documentation is available at:
<li>
  [http://docs.scipy.org/doc/](http://docs.scipy.org/doc/)
</li><br>
General SciPy documentation index is available at:
<li>
   [http://docs.scipy.org/doc/scipy/reference/index.html](http://docs.scipy.org/doc/scipy/reference/index.html)
</li><br>
</ul>
End of explanation
%matplotlib inline 
import numpy
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (12.0, 8.0)
x=numpy.linspace(0,2*numpy.pi,32)
fig = plt.figure()
plt.plot(x, numpy.sin(x))
fig.savefig('sine.png')
plt.show()
Explanation: Scientific visualization
<ul>
General Matplotlib references:<br>
<li>
  [Matplotlib main web site: http://matplotlib.org/](http://matplotlib.org/)
</li><br>
<li>
  [Introduction to Matplotlib at: http://scipy-lectures.github.io/matplotlib/matplotlib.html](http://scipy-lectures.github.io/matplotlib/matplotlib.html)
</li><br>
<li>
  [Matplotlib example gallery at:  http://matplotlib.org/gallery.html ](http://matplotlib.org/gallery.html)
</li><br>
</ul>
<ul>
Other Python-based visualization tools:<br>
<li>
  [https://wiki.python.org/moin/NumericAndScientific/Plotting](https://wiki.python.org/moin/NumericAndScientific/Plotting)
</li><br>
<li>
  [Plotly: https://plot.ly/](https://plot.ly/)
</li><br>
<li>
  [Mayavi: http://code.enthought.com/projects/mayavi/ ](http://code.enthought.com/projects/mayavi/)
</li><br>
</ul>
End of explanation
<END_TASK>