in Chapter 3 numpy and matplotlib gaussian function challenge:
# Gaussian Function
1. Create a function called gauss which will take three arguments (inputs): x, µ, and σ, as defined above. Hint: you may wish to use the NumPy constant pi, and NumPy functions square, sqrt and exp for calcuating the square, square-root and exponential of e respectively for all elements in an array.
2. Create a NumPy array using the Numpy function linspace which will contain 1000 points equally spaced between x=-100 and x=100. Hint: You can print the help documentation of a function with ‘help(name_of_the_function)’.
3. Using the above gauss function and the array, create an array which contains the values of the Gaussian from x=-100 to x=100.
4. Use the ‘matplotlib’ library to plot the curve with µ=0 and σ=10.
give the answer to 1 first, because it is quite involved and time consuming, then students can focus on making the numpy arrays and plotting.
in Chapter 3 numpy and matplotlib gaussian function challenge:
give the answer to 1 first, because it is quite involved and time consuming, then students can focus on making the numpy arrays and plotting.