Re: Finding strings values common to two (large!) arrays [message #92198 is a reply to message #92197] |
Wed, 28 October 2015 12:26   |
Russell[1]
Messages: 101 Registered: August 2011
|
Senior Member |
|
|
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
On Wednesday, October 28, 2015 at 12:40:24 PM UTC-4, Jeremy Bailin wrote:
> On Wednesday, October 28, 2015 at 12:25:10 PM UTC-4, rrya...@gmail.com wrote:
>> On Wednesday, October 7, 2015 at 10:13:59 AM UTC-4, rj...@le.ac.uk wrote:
>>> I have arrays of numerical IDs in string format.
>>>
>>> I want to find all of the indices in Array A that contain a value that is present anywhere in Array B.
>>>
>>> The arrays are both quite large (>1 million values) so a loop is out of the question and them being strings complicates it as well.
>>>
>>> Any IDL Way tips?
>>
>> AGGH! Jeremy beat me to it. I would think you want to map your strings onto the unique set of integers following Jeremy's post. Then perhaps you could use histogram on the mapped integers.
>>
>> -Russell
>
> You know I'm not going to miss a chance to spread the gospel of value_locate! :)
>
> -Jeremy.
|
|
|