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

Home » Public Forums » archive » Count duplicate elements in an array but keep their order!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Count duplicate elements in an array but keep their order! [message #85885 is a reply to message #85758] Mon, 16 September 2013 10:51 Go to previous message
Steve Daal is currently offline  Steve Daal
Messages: 13
Registered: October 2011
Junior Member
On Tuesday, September 3, 2013 7:58:33 AM UTC-5, David Fanning wrote:
> Josh Sixsmith writes:
>
>
>
>> The following might work.
>
>> Using the UNIQ function will give the indices, which you can use to get the value counts.
>
>> To get the counts for each value you'll then need to use the SHIFT function to offset the indices in order subtract from the original indices.
>
>
>
> Using the UNIQ function on a floating point array is probably a bad
>
> idea. You might find that ALL your floating point numbers are unique,
>
> depending upon how you arrive at them.
>
>
>
> I think to solve this problem you are going to have to convert the
>
> floats to integers of whatever degree of "floating" accuracy makes sense
>
> for the problem. Then work with the integers to find, count, and remove
>
> duplicates.
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Thanks Josh and David. That helped a lot.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Evenly timed events in a widget program
Next Topic: Texture image on a 3d curve: cgsurface and xobjview problems

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

Current Time: Wed Oct 08 19:36:59 PDT 2025

Total time taken to generate the page: 0.00492 seconds