1. Engineering
  2. Computer Science
  3. please use python3 to solve the following question...

Question: please use python3 to solve the following question...

Question details

Please Use Python3 to solve the following question:

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. are 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: : If a parameter Pi is present in both source 1 and source 2, the parameter from the higher priority source, source 2, is 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 or a parameter is encountered rom a higher preferred site, the old data is superseded. Assuming three sources S1 S Eliminate algorithm S S c minate-algorithm Eliminate-algorithm(S1,S2), S3) Given a list of sources S1, S2.... Sn, find the final parameter list given by Eliminate-algorithm($1, S2....sn). 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 byhold 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-[IP1.x). P2.yL.IP5,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.indexlP1I1] with the new value b. Do the same with

Sample Input 0 P1:b P2:q P5:x Sample Output 0

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

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution