python - Decrease array size by averaging adjacent values with numpy -



python - Decrease array size by averaging adjacent values with numpy -

i have big array of thousands of vals in numpy. want decrease size averaging adjacent values. example:

a = [2,3,4,8,9,10] #average downwards 2 values here = [3,9] #it averaged 2,3,4 , 8,9,10

so, basically, have n number of elements in array, , want tell average downwards x number of values, , averages above.

is there way numpy (already using other things, i'd stick it).

as mentioned in comments, want probably:

group = 3 = a.reshape(-1, group).mean(axis=1)

python arrays numpy mean

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -