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

Home » Public Forums » archive » Finding strings values common to two (large!) arrays
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: Finding strings values common to two (large!) arrays [message #92202 is a reply to message #92198] Wed, 28 October 2015 14:48 Go to previous messageGo to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
On Wednesday, 28 October 2015 12:26:30 UTC-7, rrya...@gmail.com wrote:
> Yeah, I learned that trick from your posts on Fanning's webpage. It's been a revelation. But i still don't like the structure of:
>
> id = id[uniq(id,sort(id))]
>
> i wish uniq just had a built-in flag to do this for me... Under what circumstance would I want to *NOT* sort? Seems like if they just built uniq to sort by default, you could probably optimize this at the compiler level --- though I'm hardly an expert...
>
> id = id[uniq(id)] ;would be nice or just
>
> -R

As of IDL 8.4, you can now do this:

IDL> a = [6, 2, 8, 3, 1, 8, 5, 3] ; (first digits of tau)
IDL> a.uniq()
1 2 3 5 6 8

Reference: IDL_Variable::Uniq
http://www.exelisvis.com/docs/IDL_Variable.html#Uniq

Cheers,
-Dick

Dick Jackson Software Consulting Inc.
Victoria, BC, Canada --- http://www.d-jackson.com
[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: point on an image()
Next Topic: Histogram within a colorbar

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

Current Time: Wed Oct 08 13:58:32 PDT 2025

Total time taken to generate the page: 0.00392 seconds