writing array

Piet van Oostrum piet at cs.uu.nl
Fri Apr 10 09:44:30 EDT 2009


>>>>> heidi taynton <heidihannah at mac.com> (ht) wrote:

>ht> Hey guys,


>ht> I'm trying to write a new array from the one i already have....  


>ht> but here is the catch:

>ht> I want an array where  n=# of data points used in previous point (rounded down)
>ht> in every spot, I want to take 1.1**n  data points and then take the mean of the data points. (i know there is a numpy function mean() ).. put that is spot 0  and so on... any suggestions?     

>ht> for clarification:
>ht> so the first spot takes 1 data point, b/c 1.1^0 =1   and the average of that is just the data point
>ht> the second spot takes 2 data points b/c 1.1^1=1.1  which rounds up to 2....  then the average of those two 
>ht> the third spot takes 4 data points b/c 1.1^2 = 1.21 ....   and then that will repeat....   

>ht> make sense?

Not much. As 1.1^2=1.21, I would think this would then take 2
datapoints, not 4. If you take at each step n = 1.1^n (rounded up) n
will stay at 2 forever.
And first you talk about rounding down, later about rounding up. So what
is it.

Maybe you should give a better specification?
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org



More information about the Python-list mailing list