John Washakie wrote:
> Hello, I'm trying to calculate an average for columns in my
> array(data), there's a catch though, I want to create a new array of
> shorter length (NOTE: this crashes at line 8):
> 
> 1) tinit = data[0][0]
> 2)    for d in data:
> 3)        if d[0] <= tinit+60:
> 4)            sum = sum+d
> 5)        else:
> 6)            avg = sum/len(sum)
> 7)            newData = append([newData],[avg],axis=0)
> 8)            tinit = d[0]
> 
> I cannot figure out how to append, column_stack, or otherwise deal
> with the newData array! Input on this simple task would be greatly
> appreciated!!

Can you give some more details? What is newData? What do you want to add 
to it? what is the axis=0 for?

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to