Note: The maximum mark that you can received for this question depends on whether you use loops to solve the problem or

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Note: The maximum mark that you can received for this question depends on whether you use loops to solve the problem or

Post by answerhappygod »

Note The Maximum Mark That You Can Received For This Question Depends On Whether You Use Loops To Solve The Problem Or 1
Note The Maximum Mark That You Can Received For This Question Depends On Whether You Use Loops To Solve The Problem Or 1 (145.22 KiB) Viewed 50 times
Need urgently will upvote please do it within 1 hour
Note: The maximum mark that you can received for this question depends on whether you use loops to solve the problem or not. If you do not use loops, you can get the maximum; otherwise, if you do use loops (either for or while), then the most you can get is 70% of the maximum. Your task is to write a Python function q4_func with the following def line: def 04_func(expt_data, diff): where • The input expt_data is a 2-dimensional numpy array of type float. • The input diff is a scalar of type float. The function q5_func returns a 1-dimensional numpy array of type int. We will explain what the function should do using an example. In this example, expt_data is the following array and diff is 1: 24.1 18.2 23 24.9 34 33.3 21 29 31 33.4 35 36 20.1 23.2 25.4 26.9 33 30.2 19 18.8 21.4 22 25.7 24.8 Each row represents sensor measurements for a day. You can interpret each row of the array as the sensor measurements for six sensors (six columns). The above example provides sensor measurements for four consecutive days (four rows). The function calculates, for each column, the mid-point between the minimum value and the maximum value of that column. If the difference between the mid-point of a column and that column's mean value is more than diff, that column's index is selected. The function returns all such selected indices, in ascending order, as a 1-dimension numpy array. In the above example, For column O, the mid-point between minimum value 19 and maximum value 24.1 is 21.55. For column 1, the mid-point between minimum value 18.2 and maximum value 29 is 23.6, and so on. The mid-point values for all the columns are [21.55, 23.6, 33.4, 27.7, 30.35, 30.4] The mean values for all the columns are [21.05, 22.3, 30.2, 26.8, 31.925, 31.075] The function returns a 1-dimension array with the selected indices, for the given diff value of 1. [1, 2, 4] . Requirements and testing: You must write the function q4_func in a file with the filename 04.py. The submission system will only accept this filename. A template file q4.py has been provided. • You can use the file test_94.py for testing. The file offers only simple tests, you need to extensively test your solution for additional test cases. • You do not need to submit test_94.py. Make sure that you save your file before submission. .
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply