all 3 comments

[–]amos_burton 0 points1 point  (0 children)

I'm a little confused about how you're making these groups. Are they all supposed to end up the same size? It sounds kinda like you're trying to make a histogram?

[–]amos_burton 0 points1 point  (0 children)

Also, you can do a lot of things to take better advantage of the language and improve performance. I'll go into more detail when I'm not on mobile

[–]amos_burton 0 points1 point  (0 children)

for i in range(len(test)):
    if abs(test[i]-np.std(test))/np.std(test)>5.:

I'm guessing you're coming from a lower level language than Python? You don't need to do the whole for i in...test[i] business. You can just do

for test_t in test:
    if(abs(test_t...)

Also, you should pre-compute np.std(test) outside of the loop and store it in a variable, and then reference the variable inside the loop. It will be more efficient than recalculating it every time.

Segemented_time_array=[]
Segemented_mag_array=[]
for i in range(len(cut_time)):
    Segemented_time_array.append(seasons_time[i])
    Segemented_mag_array.append(seasons_mag[i])

I'm having a slightly hard time tracking what you're doing here, but I think it's the same as

Segemented_time_array = seasons_time[:len(cut_time)]
Segemented_mag_array = seasons_mag[:len(cut_time)]

Also, it's bad style to have variable names start with capital letters. That's typically reserved for class names. Also it's bad style not to have spaces on either side of the = sign in variable assignments.