Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Array being zeroed out, looking for help determining why

I have a global array buy_percentage.

If I print the values of the array as each value in it is calculated, I get the expected return values.
Immediately after that for loop is exited, the array's values all become 0. Oddly, looking at the log when I place 'Print buy_percentage' after the for loop exits, each spot array is either the integer '0' or the float '0.0', with each slot changing (seemingly) at random in each subsequent log entry - which implies that something is being written to it, somehow...

    for index in range(len(seclist)):  
            #[bunch of math snipped out]  
            buy_percentage[index] = ((abs(rel_mov[index])//sum_to_distribute) * Big_N)*min((1+sder[index]),2)  
            #at this point, print buy_percentage[index] yields the expected range of values (around 0.6 to 0.8)  
    temp = 0  
    #at this point every value in the array buy_percentage is 0.  
    for i in range(len(seclist)):  
        #normalizes percentages  
        temp += buy_percentage[i]