You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Give gauss function for the Gaussian Function challange #114
in Chapter 3 numpy and matplotlib gaussian function challenge:
# Gaussian Function1. 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.
Would it make sense to add this to Chapter 1? It currently doesn't have any exercises on Functions, which I think is covered in the intro course. I think it would be good to have 1-2 exercises for functions there to reinforce attendee's skills.
Good point. I don't think this challenge is suitable for Chapter 1 because it relies too much on numpy, but the recap would benefit from a simpler challenge on using functions. I'll make a separate issue for that
Activity
BMatischen01 commentedon May 1, 2026
Would it make sense to add this to Chapter 1? It currently doesn't have any exercises on Functions, which I think is covered in the intro course. I think it would be good to have 1-2 exercises for functions there to reinforce attendee's skills.
Scottan commentedon May 1, 2026
Good point. I don't think this challenge is suitable for Chapter 1 because it relies too much on numpy, but the recap would benefit from a simpler challenge on using functions. I'll make a separate issue for that