(Solved) : Investor Makes Buying Selling Decisions Based Set Observations Recorded Analyzed Valid Dat Q34197938 . . .

Please use Python3 to solve the following question(Please readthe function description carefully!):

An investor makes buying and selling decisions based on a set of observations that are recorded and analyzed. To have the most valid data, investors get data from multiple sources that are retrieved in order from least to most preferred. Data is aggregated using the eliminate algorithm which arrives at a single final value to use for each parameter. In short, as new parameters, they are added to the list. If a later, thus more preferred, data source provides a value for a parameter that is already in your list, its value supersedes the one from an earlier source. The eliminate algorithm is described below for data that relates to parameter Pi received from two sources: 1: If a parameter Pi is present in both source 1 and source 2, the parameter from the higher priority source, source 2,s used in the final parameter list 2: If a parameter Pi is present only in one of the sources, it is directly added to the final parameter list The result of performing the above two operations until all the parameters from source 1 and source 2 are exhausted is the result of Eliminate-algorithm(source 1, source 2). Each time a new value for a parameter is encountered from a higher preferred Eliminate-algorithm(S1,S2), S3). site, the old data is superseded. Assuming three sources S1 S2 53 Eliminate algorithm S1,S2 53-Eliminate algorithm Given a list of sources $1, S2.... Sn, find the final parameter list given by Eliminate-algorithm/S1, S2....n). Maintain your results in the order a key was first encountered A very simple example is that you receive only a rating parameter of buy, sell or hold from three sources in increasing order of preference: [buy, sell, hold) A buy rating comes in from source 1, immediately superseded by sell from source 2, immediately superseded by hold from source 3. The final rating is the only one that hasnt been superseded, so you use hold as the rating for the analysts to see. As a more complex example, you receive data from two sources as follows: The first row represents source 1, the second, source 2 and the second source is preferred. Start the analysis at source 1. Enter all of those items into our list, now results -[P1,xl[P2.yl/P5,z)) and move on to source 2. The first datapoint is for key P1 and that is already in the list. As source 2 is higher authority, replace results.indexlP11] with the new value b. Do the same with P5 Next is a new key, key P3 so it is added to the list: result [PI,bHP2 yMP5 a (P3 wy. Return a list of the second data element from each element final = [by,a,w)

Function Description Complete the function computeParameterValue in the editor below. The function must return an array of strings that denotes the final parameter list values in the order their keys were first encountered computeParameterValue has the following parameter(s): sources: a 2 dimensional array of key:value pairs, each row is one sources data, sources presented from lowest to highest preference Constraints .1sn 100 lspく1000 · ▶ Input Format For Custom Testing Sample Case 0 Sample Input 0 Sample Output 0

Final parameter list P1 b (Source 2) P3 b (Source 1) P5 x (Source 2) P2 q (Source 2)

 

Expert Answer


Answer to An investor makes buying and selling decisions based on a set of observations that are recorded and analyzed. To have th…