=: =Lab7: Exercise 2 4. Conduct element-wise multiplication by using NumPy* operator (DO NOT use any loop) Import the nu
Posted: Wed Apr 27, 2022 3:43 pm
=: =Lab7: Exercise 2 4. Conduct element-wise multiplication by using NumPy* operator (DO NOT use any loop) Import the num_list from the ex2_module.py Lab7: Exercise 2 (Full Mark: 1) Due: 25/04/2022 11:59PM 1.5 8.1 0.1 4.5 3.7 12.1 2.5 9.2 You have unlimited attempts until the submission due. Only the final submission will be marked. Sort elements in an ascending order As mentioned in the lecture 0 (page 9), we do not have any partial mark in the lab exercise. • Submit your work by pressing the Mark button at the top-right of the terminal window. 0.1 1.5 2.5 3.7 4.5 8.1 9.2 12.1 Extracting k smallest values k (k = 4) Hints: Numpy Sort (https://numpy.org/doc/stable/reference/ ... .sort.html) 0.1 1.5 2.5 3.7 * * * element-wise multiplication Run PYTHON i maent aumex as np 2 x = (100,39,65,7.4] 3 print (resent(x)) 0.1 1.5 2.5 3.7 Your program must produce the following output: [user@sahara - ] $ python ex2_script.py (1.000e-02 2.250e+00 6.250e+00 1.369e+01] Topic: Modules and Numpy Operations You have the ex2_module.py that contains a single list num list, You MUST NOT modify this module file. swabist = [1.5, 8.1, 8.1, 4.5, 3.7, 12.1, 2.5, 9.2] , , ] Write a program ex2 script.py, which conducts the following steps (drawing): 1. Import the num list from the ex2_module.py module 2. Sort elements in an ascending order by using sort() from the Numpy module 3. Extract 4 smallest values by using Numpy Array Slicing