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

Home » Public Forums » archive » array manipulation (TOTAL-ing or MEDIAN-ing) in uneven bins
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
array manipulation (TOTAL-ing or MEDIAN-ing) in uneven bins [message #82403] Wed, 12 December 2012 08:16 Go to previous message
havok2063 is currently offline  havok2063
Messages: 24
Registered: December 2012
Junior Member
I have several unrelated problems that I'm solving in the same efficient way (with loops). I'm trying to perform some array operation on an array, according to a list of (let's call them) uneven bins.

I have an array, say d, of 146 elements. I have a separate array that represents uneven bins that I want to perform the operation on, like MEDIAN, or TOTAL. For example,

ntot = [15,45,56,90,116,146]

I want as output an array, of 6 elements, that contains the MEDIAN (or TOTAL) of array d according to the indices listed in ntot.

So the 1st element would contain median(d[0:14],/even), the 2nd median(d[15:44],/even), etc....

Or the same thing with total....total(d[0:14]), total(d[15:44]) , etc...

Right now I'm looping over the number of elements in ntot to do this and I don't much care for loops.

I don't think this is quite the same thing as the example given in the "Horror and Disgust of Histogram" article nor does this sound like something I can do with value_locate, although I'm not too familiar with value_locate.

Any ideas on this? Thanks a lot.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Bug in STRMID system routine
Next Topic: Select values from one array that match multiple values from an other array

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

Current Time: Wed Oct 08 13:42:35 PDT 2025

Total time taken to generate the page: 0.00439 seconds