Re: Create new arrays from series of subsequent integers in an existing array [message #48796 is a reply to message #48794] |
Wed, 24 May 2006 15:23   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
JD Smith writes:
> Some remixing there... mostly fine, but at one point you you say
> "although not in this particular case" regarding the correctness of
> the form of reverse indices indexing. That's actually not true: both
> forms are correct, it's just that with the data[index_vector] form,
> it's not easy to extend the range of indices by one. You could
> actually say:
>
> data[[index_vector,index_vector[n_elements(index_vector)-1]] ]
>
> and this would do it just as well. Using the data[low:high] trick,
> where you know you have consecutive indices in your HISTOGRAM bin,
> just allows you to append one to the range of indices to recover that
> mis sing member of the group. So both are correct, but one is more
> convienent.
OK, I don't honestly know what it means either way, but I
fixed it to indicate both are correct. :-)
Cheers,
David
P.S. Let's just say if both are correct, the solution is even
MORE of a mystery to me! And I like it that way.
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|