<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> Crash Course in Python</h1>
Python is a powerful programming language that bears many similarities with matlab, C and fortran. The following crash course will take you through some of the key features we will use in ME 249. To install python 3.5, go to <a href="https
Step1:  <h2>1.2 Basic operators <FONT FACE="courier" style="color
Step2:  <h3>1.3 Mathematical functions</h3>
You may find all mathematical functions here </FONT>
Step3:  <h3>1.4 Booleans</h3>
Logical operations result in <FONT FACE="courier" style="color
Step4:  Let's take a pause here to discuss <FONT FACE="courier" style="color
Step5:  <h3>1.5 Loops</h3>
A key element of scientific computing is the ability to loop or iterate. You have two options
Step6:  <h2>2 Matrices</h2>
Matrices are central to CFD as we will see in future problems. The library or module <FONT FACE="courier" style="color
Step7:  <h3>2.3 The problem with arrays
Step8:  Now, I want to modify the last element <FONT FACE="courier" style="color
Step9:  Both my arrays have been changed!!! The same is not true for simple variables
Step10:  The fix for arrays is to use <FONT FACE="courier" style="color
Step11:  Note that when you perform an operation on <b>all</b> the elements of your array, the problem of linking your old array and new array disappears
Step12:  which is equivalent to
Step13:  but this is bad
Step14:  <h3>2.4 Array operations</h3>
To perform operations an all elements, <FONT FACE="courier" style="color
Step15:  Note that you need to use the <FONT FACE="courier" style="color
Step16:  <p class='alert alert-danger'>
Getting errors is part of code development. Python will provide sometimes short, sometimes way too long error messages. Before you throw your hands in the air, give up and immediately email the TA or the instructor, browse the error message for things that could make sense. Typically, the last line contains useful information. Here it says that <FONT FACE="courier" style="color
Step18:  Using indexing and slicing is much more computationally efficient than using a for loop, here is a proof. The next cell creates a large array of random numbers using a normal distribution.
<ASSISTANT_TASK:>
Python Code:
import math
print("pi = %1.15f" %math.pi)
print("pi = %1.15e" %math.pi)
import numpy as np
import scipy as scp
print(" numpy pi = %1.15f" %np.pi)
print(" scipy pi = %1.15f" %scp.pi)
Explanation: <h1> Crash Course in Python</h1>
Python is a powerful programming language that bears many similarities with matlab, C and fortran. The following crash course will take you through some of the key features we will use in ME 249. To install python 3.5, go to <a href="https://www.continuum.io/downloads">https://www.continuum.io/downloads</a>
<h2>1. Simple Mathematical Operation</h2>
The python software installed on your computer contains many libraries, the main ones used in ME 249 are:
<ul>
<li> <FONT FACE="courier" style="color:blue">matplotlib </FONT>: <a href="http://matplotlib.org">http://matplotlib.org</a> for examples of plots you can make in python.</li>
<li> <FONT FACE="courier" style="color:blue">math </FONT>: <a href="https://docs.python.org/3/library/math.html">https://docs.python.org/3/library/math.html</a> for mathematical constants and functions.</li>
<li><FONT FACE="courier" style="color:blue">numpy </FONT>: <a href="http://docs.scipy.org/doc/numpy/user/index.html">http://docs.scipy.org/doc/numpy/user/index.html</a> Library for operations on matrices and vectors.</li>
<li><FONT FACE="courier" style="color:blue">scipy </FONT>: <a href="https://www.scipy.org/">https://www.scipy.org/</a> Library for fundamental mathematical operations (e.g. ODE solvers).</li>
</ul>
Loading a libray in python is done by the command <FONT FACE="courier" style="color:blue">import</FONT>. The best practice is to take the habit to use 
<FONT FACE="courier" style="color:blue">import [library] as [library_nickname]</FONT>
<h3>1.1 Printing $\pi$</h3>
The constant $\pi$ is available from all three libraries (math, numpy, scipy). Here I don't give a shorthand name to math, to illustrate how <FONT FACE="courier" style="color:blue">import</FONT> works with or without <FONT FACE="courier" style="color:blue">as</FONT>.
The <FONT FACE="courier" style="color:blue">print</FONT> command here takes a string <FONT FACE="courier" style="color:blue">"pi = %1.15f"</FONT> where <FONT FACE="courier" style="color:blue">%1.15f</FONT> signals the print command that a floating number of the form
$$
\underbrace{x}{1}.\underbrace{abcdefghijklmno}{15}
$$
is expected. This number is passed onto the print command via <FONT FACE="courier" style="color:blue">%math.pi</FONT>.
End of explanation
print("1+2 = ", 1+2)
print("1.0+2 = ", 1.0+2)
print("1.0+2.0 = ", 1.0+2.0)
print("4/2 = ", 4/2)
print("4//2 = ", 4//2)
print("8//3 = ", 8//3)
print("8/3 = ", 8/3)
print("Integer of 8/3 = ", int(8/3))
print("(2.5,3.0) =", 2.5+3.0j)
print("2^4 = ", 2**4)
print("2.0^4 = ", 2.**4)
print("2.0^4 = ",pow(2.0,4))
a = 10.
a *= 9.
print("a = 10. then a *= 9.=",a)
Explanation: <h2>1.2 Basic operators <FONT FACE="courier" style="color:blue">+,-,\*,/,//,**</FONT></h2>
A few things you should know about python 3:
<ol>
<li><FONT FACE="courier" style="color:blue">2</FONT> is an integer, <FONT FACE="courier" style="color:blue">2.0</FONT> is a floating point number, <FONT FACE="courier" style="color:blue">(2.0+3.0j)</FONT> is a complex.</li>
<li>The division operator returns a floating point number. To perform the division of two integers and expect an integer number as the result, use <FONT FACE="courier" style="color:blue">//</FONT> or <FONT FACE="courier" style="color:blue">int()</FONT></li>
<li>The power operation $x^y$ is <FONT FACE="courier" style="color:blue">x**y</FONT> or <FONT FACE="courier" style="color:blue">pow(x,y)</FONT>. </li>
<li><FONT FACE="courier" style="color:blue">a += 1</FONT> is a shorthand for <FONT FACE="courier" style="color:blue">a = a + 1</FONT>, same for subtraction, multiplication and division.
</ol>
End of explanation
print("e^1=",math.exp(1.))
print("e^(-infinity)=",math.exp(-math.inf))
print("log(e)=", math.log(math.e))
print("log_10(1000.)=",math.log10(1000.))
a = math.cos(math.pi/4.)
print("a = cos(pi/4) = %1.8f" %a)
print("arcos(a)*4./pi = ",math.acos(a)*4./math.pi)
Explanation: <h3>1.3 Mathematical functions</h3>
You may find all mathematical functions here </FONT>: <a href="https://docs.python.org/3.5/library/math.html">https://docs.python.org/3.5/library/math.html</FONT>.
End of explanation
print("1 equal 2:",1==2)
print("1 non-equal 2:",1!=2)
print("1 > 2:",1>2)
print("1 < 2:",1<2)
print("10.==sqrt(100.):",10.==math.sqrt(100.))
a = 0
if a > 0:
    a -= 1
elif a == 0:
    a = 1
print(a)
Explanation: <h3>1.4 Booleans</h3>
Logical operations result in <FONT FACE="courier" style="color:blue">True</FONT> or <FONT FACE="courier" style="color:blue">False</FONT> outcomes. They mostly drive <FONT FACE="courier" style="color:blue">if</FONT> and <FONT FACE="courier" style="color:blue">while</FONT> statements.
End of explanation
a = 4
b = 0
if a > 0 and a < 4:
    a += 1
    b = 3
else:
    a = 0
    b = 1
print(a,b)
a = 4
b = 0
if a > 0 or a < 4:
    a += 1
    b = 3
else:
    a = 0
    b = 1
print(a,b)
Explanation: Let's take a pause here to discuss <FONT FACE="courier" style="color:blue">if, while, for</FONT> statements. The indentation at the line following <FONT FACE="courier" style="color:blue">if a>0:</FONT> is critical. It means that all the lines with such indentation following <FONT FACE="courier" style="color:blue">if a>0:</FONT> are part of the actions needed if <FONT FACE="courier" style="color:blue">a>0 = True</FONT>. Try the following cells using <FONT FACE="courier" style="color:blue"> a = 1 </FONT> and <FONT FACE="courier" style="color:blue">if a=4</FONT>. Note also the role of the boolean operators <FONT FACE="courier" style="color:blue">and</FONT> and <FONT FACE="courier" style="color:blue">or</FONT>. Note also that each <FONT FACE="courier" style="color:blue">if, while, for</FONT> statements need to end with <FONT FACE="courier" style="color:blue">:</FONT> to signal that the following indented lines are part of the statement.
End of explanation
for i in range(0,5,1):
    print(i)
for i in range(5):
    print(i)
for i in range(3,5):
    print(i)
for i in range(5,2,-1):
    print(i)
a = 0
while a <=5 :
    print(a)
    a += 1
print("final a=",a)
Explanation: <h3>1.5 Loops</h3>
A key element of scientific computing is the ability to loop or iterate. You have two options: <FONT FACE="courier" style="color:blue">for</FONT> and <FONT FACE="courier" style="color:blue">while</FONT>:
<ul>
<li><FONT FACE="courier" style="color:blue">for i in range(lower, upper, step):</FONT> "range(lower, upper, step)" returns an iterable list of numbers from the lower number to the upper number (-1, if step>0, +1 if step<0), while incrementing by step. If step is not indicated, the default value is 1.</li>
<li><FONT FACE="courier" style="color:blue">while condition:</FONT> This loop will run while condition is true.</li>
</ul>
Here are some examples:
End of explanation
import numpy as np
n = 10
a = np.zeros(n)
print("a = ",a)
m = 3
b = np.ones((m,n))
print("b = ",b)
c = np.array([1, 2, 3, 4])
print("c = ",c)
d = np.array([[1, 2], [3, 4]], dtype = np.complex)
print("d = ",d)
a = np.ones((2,2), dtype = 'float64')
for j in range(2):
    for i in range(2):
        a[i,j] *= np.float64(math.pi/(i+j+1))
print(a)
print("a[0,0] =",a[0,0])
Explanation: <h2>2 Matrices</h2>
Matrices are central to CFD as we will see in future problems. The library or module <FONT FACE="courier" style="color:blue">numpy</FONT> contains all the definitions and operators necessary for matrix operations.
<h3>2.1 Initialization of a matrix</h3>
You may set a matrix/vector to zero, unity or the values you may choose using <FONT FACE="courier" style="color:blue">numpy</FONT> functions <FONT FACE="courier" style="color:blue">zeros</FONT>, <FONT FACE="courier" style="color:blue">ones</FONT>, and <FONT FACE="courier" style="color:blue">array</FONT>. Please note:
<ul>
<li> Indices always start at 0. More on that later.</li>
<li> For one dimension array (vector) the syntax to initialize an array is <FONT FACE="courier" style="color:blue">np.zeros(n)</FONT>, however for multiple-dimension arrays, the argument to be passed to <FONT FACE="courier" style="color:blue">zeros</FONT> or <FONT FACE="courier" style="color:blue">ones</FONT> is a <b>tuple</b> <FONT FACE="courier" style="color:blue">(p,q,r)</FONT> like this: <FONT FACE="courier" style="color:blue">np.zeros((p,q,r))</FONT></li>
<li> <FONT FACE="courier" style="color:blue">dtype</FONT> allows for the specification of the variable format. There are many ways to pass the format:  <FONT FACE="courier" style="color:blue">'int'</FONT>, <FONT FACE="courier" style="color:blue">'float32'</FONT>, <FONT FACE="courier" style="color:blue">'float64'</FONT>, <FONT FACE="courier" style="color:blue">'float'</FONT>, <FONT FACE="courier" style="color:blue">'complex64'</FONT>, <FONT FACE="courier" style="color:blue">'complex128'</FONT>, <FONT FACE="courier" style="color:blue">'complex'</FONT>. By default <FONT FACE="courier" style="color:blue">'float'</FONT> and <FONT FACE="courier" style="color:blue">'complex'</FONT> are 64 bits and 128 bits, respectively, or the same as <FONT FACE="courier" style="color:blue">'float64'</FONT> and <FONT FACE="courier" style="color:blue">'complex128'</FONT>. Should you be short on memory you may revert to <FONT FACE="courier" style="color:blue">'float32'</FONT> and <FONT FACE="courier" style="color:blue">'complex64'</FONT> with a loss of accuracy. In the second cell below, hange float64 to 32.</li>
</ul>
End of explanation
n = 10
a = np.zeros(n, dtype = np.float)
for i in range(n):
    a[i] = 2.**i
print("a = ",a)
Explanation: <h3>2.3 The problem with arrays: <FONT FACE="courier" style="color:blue">=</FONT></h3>
Any programming language has a quirk or two, that may baffle/annoy you. May be it is only me, but I find the equal sign in python dangerous. Here is why. First we define an array
$$
a_i = 2^i,\;i=0,\ldots,9
$$
End of explanation
b = a
b[n-1] -= 500.
print("a = ",a)
print("b = ",b)
Explanation: Now, I want to modify the last element <FONT FACE="courier" style="color:blue">a[n-1]</FONT> but in a different array to keep my initial array intact (something quite common in CFD).
End of explanation
a = 1.
b = a
b += 1.
print("a=",a)
print("b=",b)
Explanation: Both my arrays have been changed!!! The same is not true for simple variables:
End of explanation
n = 10
a = np.zeros(n)
for i in range(n):
    a[i] = 2.**i
b = np.copy(a)
b[n-1] -= 500.
print("a = ",a)
print("b = ",b)
Explanation: The fix for arrays is to use <FONT FACE="courier" style="color:blue">np.copy</FONT>:
End of explanation
n = 10
a = np.zeros(n)
for i in range(n):
    a[i] = 2.**i
b = a * 2.
print("a = ",a)
print("b = ",b)
Explanation: Note that when you perform an operation on <b>all</b> the elements of your array, the problem of linking your old array and new array disappears:
End of explanation
n = 10
a = np.zeros(n)
for i in range(n):
    a[i] = 2.**i
b = np.copy(a)
b *= 2.
print("a = ",a)
print("b = ",b)
Explanation: which is equivalent to:
End of explanation
n = 10
a = np.zeros(n)
for i in range(n):
    a[i] = 2.**i
b = np.zeros(n)
b = a
b *= 2.
print("a = ",a)
print("b = ",b)
Explanation: but this is bad:
End of explanation
n = 4
a = np.zeros(n, dtype = np.float64)
for i in range(n):
    a[i] = 2.**i
print("a=",a)    
b = np.copy(a)
b += 1.
print("b=a+1=",b)
b = np.zeros(n, dtype = np.float64)
for i in range(n):
    b[i] = np.float64(i)
print("a=",a)
print("b=",b)
print("a*b=",a*b)
print("a.b=",np.dot(a,b))
print("exp(-a)=",np.exp(-a))
Explanation: <h3>2.4 Array operations</h3>
To perform operations an all elements, <FONT FACE="courier" style="color:blue">numpy</FONT> has many functions. In the following, we
<ul>
<li>Add 1 to all elements</li>
<li>Multiply two matrices, element by elements</li>
<li>Perform the dot product between two vectors</li>
<li>Perform a mathematical operation</li>
</ul>
End of explanation
print("exp(-a)=",math.exp(-a))
Explanation: Note that you need to use the <FONT FACE="courier" style="color:blue">exp</FONT> of <FONT FACE="courier" style="color:blue">numpy</FONT> and not from <FONT FACE="courier" style="color:blue">math</FONT>, otherwise you get this:
End of explanation
%matplotlib inline 
# plots graphs within the notebook
%config InlineBackend.figure_format='svg' # not sure what this does, may be default images to svg format
from IPython.display import Image
from IPython.display import clear_output
from IPython.core.display import HTML
def header(text):
    raw_html = '<h4>' + str(text) + '</h4>'
    return raw_html
def box(text):
    raw_html = '<div style="border:1px dotted black;padding:2em;">'+str(text)+'</div>'
    return HTML(raw_html)
def nobox(text):
    raw_html = '<p>'+str(text)+'</p>'
    return HTML(raw_html)
def addContent(raw_html):
    global htmlContent
    htmlContent += raw_html
    
class PDF(object):
  def __init__(self, pdf, size=(200,200)):
    self.pdf = pdf
    self.size = size
  def _repr_html_(self):
    return '<iframe src={0} width={1[0]} height={1[1]}></iframe>'.format(self.pdf, self.size)
  def _repr_latex_(self):
    return r'\includegraphics[width=1.0\textwidth]{{{0}}}'.format(self.pdf)
PDF('figures/indexing.pdf',size=(800,600))
n = 6
a = np.zeros(6,dtype=np.float)
for i in range(n):
    a[i] = 2**i
print("a[0:n] = ",a[0:n])
print("a[:] = ",a[:])
print("a[1:]  = ",a[1:])
print("a[1:n] = ",a[1:n])
print("a[0:n]   = ",a[0:n])
print("a[0:n-1] = ",a[0:n-1])
print("a[0:-1]  = ",a[0:-1])
print("a[:-1]   = ",a[:-1])
print("a[2:] = ",a[2:])
print("a[:-3]= ",a[:-3])
b = np.zeros(n,dtype=np.float)
b[:-1] = a[1:] - a[:-1]
print("a[1:]  =",a[1:])
print("-")
print("a[:-1] =",a[:-1])
print("       =",b[:-1])
Explanation: <p class='alert alert-danger'>
Getting errors is part of code development. Python will provide sometimes short, sometimes way too long error messages. Before you throw your hands in the air, give up and immediately email the TA or the instructor, browse the error message for things that could make sense. Typically, the last line contains useful information. Here it says that <FONT FACE="courier" style="color:blue">math.exp</FONT> is expecting a scalar but we gave a length-1 array.
</p>
<h3>2.5 Indexing and Slicing</h3>
A very attractive feature of python is the nomenclature for indexing and slicing that enables to maximize the efficiency of vector operations. Here is a summary of the indexing and slicing nomenclature for a vector:
End of explanation
n = 100000
mu = 0.
sigma = 1.
a = np.random.normal(loc = mu, scale = sigma, size = n)
print("a[:-(n-10)] = ", a[:-(n-10)])
print("a[0:10] = ", a[0:10])
%matplotlib inline 
# plots graphs within the notebook
%config InlineBackend.figure_format='svg' # not sure what this does, may be default images to svg format
from IPython.display import display,Image, Latex
from __future__ import division
from sympy.interactive import printing
printing.init_printing(use_latex='mathjax')
import time
from IPython.display import display,Image, Latex
from IPython.display import clear_output
#import SchemDraw as schem
#import SchemDraw.elements as e
import matplotlib.pyplot as plt
import numpy as np
import math
import scipy.constants as sc
import sympy as sym
from IPython.core.display import HTML
def header(text):
    raw_html = '<h4>' + str(text) + '</h4>'
    return raw_html
def box(text):
    raw_html = '<div style="border:1px dotted black;padding:2em;">'+str(text)+'</div>'
    return HTML(raw_html)
def nobox(text):
    raw_html = '<p>'+str(text)+'</p>'
    return HTML(raw_html)
def addContent(raw_html):
    global htmlContent
    htmlContent += raw_html
    
class PDF(object):
  def __init__(self, pdf, size=(200,200)):
    self.pdf = pdf
    self.size = size
  def _repr_html_(self):
    return '<iframe src={0} width={1[0]} height={1[1]}></iframe>'.format(self.pdf, self.size)
  def _repr_latex_(self):
    return r'\includegraphics[width=1.0\textwidth]{{{0}}}'.format(self.pdf)
class ListTable(list):
     Overridden list class which takes a 2-dimensional list of 
        the form [[1,2,3],[4,5,6]], and renders an HTML Table in 
        IPython Notebook. 
    
    def _repr_html_(self):
        html = ["<table>"]
        for row in self:
            html.append("<tr>")
            
            for col in row:
                html.append("<td>{0}</td>".format(col))
            
            html.append("</tr>")
        html.append("</table>")
        return ''.join(html)
    
font = {'family' : 'serif',
        #'color'  : 'black',
        'weight' : 'normal',
        'size'   : 12,
        }
fontlabel = {'family' : 'serif',
        #'color'  : 'black',
        'weight' : 'normal',
        'size'   : 16,
        }
from matplotlib.ticker import FormatStrFormatter
plt.rc('font', **font) 
import matplotlib.pyplot as plt
count, bins, ignored = plt.hist(a, 50, normed=True)
plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) * \
         np.exp( - (bins - mu)**2 / (2 * sigma**2) ),\
         linewidth=2, color='r')
plt.xlabel(r"a", fontdict = fontlabel)
plt.ylabel(r"pdf", fontdict = fontlabel)
plt.show()
n = 100
mu = 0.
sigma = 0.2
x = np.linspace(0,1.,n)
a = np.sin(2.*math.pi*x)
plt.plot(x,a, lw = 2)
plt.xlabel(r"x", fontdict = fontlabel)
plt.ylabel(r"a(x)", fontdict = fontlabel)
plt.show()
a_noisy = np.copy(a)
n_noise = 4
k_noise = 50
noise_amplitude = np.random.normal(loc = mu, scale = sigma, size = n_noise)
noise_phase = 2*math.pi*np.random.normal(loc = mu, scale = 1.0, size = n_noise)
for i in range(n_noise):
    a_noisy += noise_amplitude[i]*np.sin(2*(k_noise+i)*math.pi*x + noise_phase[i])
plt.plot(x,a_noisy, lw = 2)
plt.xlabel(r"x", fontdict = fontlabel)
plt.ylabel(r"a(x)", fontdict = fontlabel)
plt.show() 
print(noise_amplitude)
print(noise_phase)
a_filter = np.zeros(n)
a_filter[1:-1] = (a_noisy[0:-2] + 2. * a_noisy[1:-1] + a_noisy[2:])/4.
a_filter[0] = (a_noisy[n-2] + 2. * a_noisy[0] + a_noisy[1])/4.
a_filter[n-1] = a_filter[0]
plt.plot(x,a_noisy, linestyle="solid", lw = 1, label = r"noisy signal")
plt.plot(x,a_filter, color = "red",linestyle="solid", lw = 2, label = r"filtered signal")
plt.plot(x,a, color = "green", linestyle="None", marker = "o", markeredgecolor = "green", markeredgewidth = 1,\
         markerfacecolor = "None", label = r"original signal")
plt.legend(loc="lower left", bbox_to_anchor=[0, 1],
           ncol=2, shadow=True, fancybox=True)
plt.xlabel(r"$x$", fontdict = fontlabel)
plt.ylabel(r"$a(x)$", fontdict = fontlabel)
plt.show() 
plt.semilogy(x,np.abs(a_noisy - a_filter), lw = 2, label=r"$\vert a_{noisy}-a_{filter}\vert$")
plt.semilogy(x,np.abs(a - a_filter), color = "red", lw = 2, label=r"$\vert a-a_{filter}\vert$")
plt.legend(loc="lower left", bbox_to_anchor=[0, 1],
           ncol=2, shadow=True, fancybox=True)
plt.xlabel(r"$x$", fontdict = fontlabel)
plt.ylabel(r"difference", fontdict = fontlabel)
%%timeit
a_filter = np.zeros(n)
for i in range(1,n-1):
    a_filter[i] = (a_noisy[i-1] + 2. * a_noisy[i] + a_noisy[i+1])/4.
a_filter[0] = (a_noisy[n-2] + 2. * a_noisy[0] + a_noisy[1])/4.
a_filter[n-1] = a_filter[0]
%%timeit
a_filter = np.zeros(n)
a_filter[1:-1] = (a_noisy[0:-2] + 2. * a_noisy[1:-1] + a_noisy[2:])/4.
a_filter[0] = (a_noisy[n-2] + 2. * a_noisy[0] + a_noisy[1])/4.
a_filter[n-1] = a_filter[0]
def explicit_filter(a):
    n = len(a)
    a_filter = np.zeros(n)
    a_filter[1:-1] = (a[0:-2] + 2.*a[1:-1] + a[2:])/4.
    a_filter[0] = (a[n-2] + 2.*a[0] + a[1])/4.
    a_filter[n-1] = a_filter[0]
    return a_filter
a_filter = explicit_filter(a_noisy)
plt.semilogy(x,np.abs(a_noisy - a_filter), lw = 2, label=r"$\vert a_{noisy}-a_{filter}\vert$")
plt.semilogy(x,np.abs(a - a_filter), color = "red", lw = 2, label=r"$\vert a-a_{filter}\vert$")
plt.legend(loc="lower left", bbox_to_anchor=[0, 1],
           ncol=2, shadow=True, fancybox=True)
plt.xlabel(r"$x$", fontdict = fontlabel)
plt.ylabel(r"difference", fontdict = fontlabel)
Explanation: Using indexing and slicing is much more computationally efficient than using a for loop, here is a proof. The next cell creates a large array of random numbers using a normal distribution.
End of explanation
<END_TASK>