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

Home » Public Forums » archive » Re: extracting values from an array
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: extracting values from an array [message #44277 is a reply to message #44276] Wed, 01 June 2005 13:06 Go to previous messageGo to previous message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
Michael Wallace wrote:
>
> If you want something a little cleaner, I'd suggest using the count
> parameter set by the where command rather than checking if w is -1 or
> not. I just find this a little easier to read.
>
> a = [2,-1, -1, 3,-1,-1, 4, -1]
> w = where(a gt -1, count)
> if count gt -1 then b = a[w]
>

I think you want

IF count GT 0 THEN ...

Cheers,
Benjamin
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Python reader for IDL save files.
Next Topic: GUI states

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

Current Time: Thu Oct 09 23:04:52 PDT 2025

Total time taken to generate the page: 0.00270 seconds