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

Home » Public Forums » archive » list manipulation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
list manipulation [message #78806] Sat, 17 December 2011 11:59
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
I'm new at using lists, so there's probably an obvious answer here, but I couldn't figure it out. I made a list containing short, variable length arrays of integers:

IDL> print,a
1 2 3
2
3 4

I'd like to find out where the individual occurrences of, say, '2' are in the list. 'where' won't do the job...

IDL> print,where(a eq 2)
1

So I thought I probably need to flatten the list first to get [1,2,3,2,3,4] and then apply 'where'. The toArray() method doesn't seem to like the variable length elements, and 'reform' is not much interested in lists. Is there a common way to do this?

cheers,
Greg
[Message index]
 
Read Message
Previous Topic: Re: How 2 access to ubuntu in my office
Next Topic: Re: list manipulation

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

Current Time: Wed Oct 08 15:31:41 PDT 2025

Total time taken to generate the page: 0.00499 seconds