Field calculator is taking long time for multiplication of two fields

2071
3
Jump to solution
11-04-2021 02:41 AM
saidurgamalleswarthota
New Contributor III

Hello all,

 

Can anyone help me to increase the speed of the field calculator in ArcGIS Pro? I've about 4000000 features. I want to calculate the aggregate average. For that, I've to perform multiplication first and do the summation. 

But the multiplication of two fields is taking more than 24 hours on my computer. My computer is i7 11 generation with ram 32GB.

Can anyone please suggest how to make this process faster or suggest any other way to calculate aggregate average faster? 

 

Thank you so much.

 The formula for average will be like, where W and D are two fields. 

scadawatch_analytical_function_wma_formula.png

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
saidurgamalleswarthota
New Contributor III

Thank you for your help. I think I found my mistake. The last time when I did the multiplication the newly created field type was selected as text. Now I chose the type as double and the field calculator is working just fine. all the calculations were under 3-4 minutes. Thanks again.

View solution in original post

3 Replies
DanPatterson
MVP Esteemed Contributor

I would can the session and reboot and try again.  Nothing should take that long for multiplication.

If you want speed, work outside the field calculator

TableToNumPyArray—ArcGIS Pro | Documentation

do the multiplication and summation in NumPy if you are python adept


... sort of retired...
DanPatterson
MVP Esteemed Contributor
from arcpy.da import TableToNumPyArray
tbl = r"C:\arcpro_npg\npg\Project_npg\npgeom.gdb\xxxx"
flds = ["A", "B"]
arr = TableToNumPyArray(tbl, flds, where_clause=None, skip_nulls=True, null_value=None)
numerator = arr["A"] * arr["B"]
denom = np.sum(arr["B"])
final = np.sum(numerator) / denom
final
49.648290039245

... sort of retired...
Tags (2)
saidurgamalleswarthota
New Contributor III

Thank you for your help. I think I found my mistake. The last time when I did the multiplication the newly created field type was selected as text. Now I chose the type as double and the field calculator is working just fine. all the calculations were under 3-4 minutes. Thanks again.