calacule feild

12-29-2021 03:14 AM
Labels (1)
New Contributor II


i want to calculate the average value of these 5 rows and ther result will be wrriten in the Group_AVerage

can someone help with this calculation ?

image :




0 Kudos
3 Replies
Regular Contributor III

I would love to help, but this makes no sense.

Amanda Bishop, GISP
0 Kudos
MVP Esteemed Contributor

Amanda, they are looking to calculate a "moving block mean", which is like a running mean but you increment the sliding/moving window by a value > 1

from numpy.lib.stride_tricks import sliding_window_view as sw
a = np.arange(1, 11)
array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10])

a0 = sw(a, 5)
a1 = sw(a, 5)[::5, :]

array([3., 4., 5., 6., 7., 8.])

array([3., 8.])

so you would have to create the array outside Pro using TableToNumPyArray

There is little point bringing back the results into an existing table, but you could generate a results array and bring it back using NumPyArrayToTable.

An interesting but pointless venture at this stage

... sort of retired...
MVP Esteemed Contributor

If you would like to interactively select the rows, and define their mean value, then

After selecting rows, right-click on the "numeric" field whose mean value you want to calculate > Statistics.


Copy the desired value, and define it to the Group_Average field using Calculate Field.


In case you have a field based on which you can categorize the groups,

1. Dissolve the table based on the category field. For Statistics Field parameters, define the numeric field . Statistics Type=Mean.

2. Then use Join Field to join the Mean_<Value> field to your original Attribute Table based on the Category Field.

Think Location