Re: Programmatically finding "significant" data points



"erikcw" wrote:

I have a collection of ordered numerical data in a list. The numbers
when plotted on a line chart make a low-high-low-high-high-low (random)
pattern. I need an algorithm to extract the "significant" high and low
points from this data.

Here is some sample data:
data = [0.10, 0.50, 0.60, 0.40, 0.39, 0.50, 1.00, 0.80, 0.60, 1.20,
1.10, 1.30, 1.40, 1.50, 1.05, 1.20, 0.90, 0.70, 0.80, 0.40, 0.45, 0.35,
0.10]

silly solution:

for i in range(1, len(data)-1):
if data[i-1] < data[i] > data[i+1] or data[i-1] > data[i] < data[i+1]:
print i

(the above doesn't handle the "edges", but that's easy to fix)

</F>



.



Relevant Pages

  • Re: Query to extract the latest version of a record
    ... > I have an audit table set up from which I want to extract the ... > What I want to do is extract the latest "EditTo"s for all records ... The origianl SQL, realigned for readability. ... above because those columns were not included in the sample data. ...
    (microsoft.public.access.queries)
  • Reading XML String
    ... I have an XML string that has been returned using a WebRequest object ... Some sample data is shown ... I now need to extract the 'Title', ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Find a phrase in a string and convert it to a number
    ... It would have helped to see some sample data and the formula used to extract ... say we have this string in A1 ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Sort 8 numbers by the 6&7th digits???
    ... this is the best newsgroup! ... >Col C will extract all the o9's ... >For the sample data in the post, ... >it'll appear in cols A to C as: ...
    (microsoft.public.excel)
  • Re: $1000 to the first person who can solve this problem
    ... Since the Secretary Problem assumes equally distributed data, ... Sample Data to test with: ... If the trend is descending then the minimum will most likely ... "algorithm" needs to wait for 5 numbers in a set to ...
    (sci.stat.math)