comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » majority voting
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
majority voting [message #65079] Wed, 11 February 2009 08:14 Go to previous message
Mort Canty is currently offline  Mort Canty
Messages: 134
Registered: March 2003
Senior Member
Hi all,

Given a 2-D array such as

0 1 1 2 1
0 2 1 1 1
1 0 2 2 1

where the entries are labels, the columns represent items and the rows
are voters, I want a IDL function that returns the majority vote labels.
So here I should get

0 ? 1 2 1

as output, where ? = "don't care". There must _not_ be a loop over
columns. I've got a clumsy solution, but I'm sure there's an elegant one
somewhere?

Cheers,

Mort
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Reading multiple ASCII files in as 2d arrays and putting them into a 3d array
Next Topic: Different issue

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:59:07 PDT 2025

Total time taken to generate the page: 0.00443 seconds