Due: 2019-09-03 by 11:59pm

Please bring your code for this assignment to class on Wednesday 2019-09-04. There will be an open notes quiz based on this material.

  1. Read
    1. Basic Mathematical Operations Using Arrays,
    2. Vectorized Operations, and
    3. Logical Operations.
  2. Using the %timeit magic and the array x, time how long it takes to sum all the numbers in the array x. You should compare the time of two different strategies. The first strategy should use the function np.sum(). The second strategy, in a separate code cell, should use a for loop to sum all the numbers in the array. Our syllabus has a good Python reference for you, if you want more information on for loops. Hereโ€™s code to produce an array x.
x = np.random.normal(size=10001)