artist has asked for the wisdom of the Perl Monks concerning the following question:
I have following structure
Assume that keys are 'years' and lists are id for some items. I like to find local max, ie.. I can select years from 1990..1999 and want to find out, which are the 10 most popular items in that window for given year. I like to have the results in strip fashion for first k items. So output should look like 'year'X 'item' where each entry in table tells me if item is popular in that year or not. Further sorting to represent minimum gaps at the top would be nice too. For example: Years( 1995..1999). The last column represents the counts in given year.$data = { 1990 => [ 1,2,3], 1991 => [2,3,5], 1992 => [1,2,7,9], .... };
ItemID 1995 1996 1997 1998 1999 20 = = = = = 5 5 = = = = 4 6 = = = = 4 7 = = = = 4 12 = = = = 4 14 = = = = 4 4 = = = 3 9 = = = 3 10 = = = 3 16 = = = 3 1 = = 2 2 = = 2 3 = = 2 8 = = 2 11 = = 2 13 = = 2 17 = = 2 19 = = 2 15 = 1 18 = 1This is not home work, and I have already written some code. I like to know, if there are any modules available..to achieve what I am looking for.
Thanks,
--Artist
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Windows Maximums
by moklevat (Priest) on Dec 20, 2006 at 17:08 UTC | |
Re: Windows Maximums
by GrandFather (Saint) on Dec 20, 2006 at 19:13 UTC | |
Re: Windows Maximums
by johngg (Canon) on Dec 20, 2006 at 20:16 UTC |
Back to
Seekers of Perl Wisdom