PROBLEM
When running the log() or math.log() function to calculate the logarithm value of a field in an attribute table using the Arcade and Python parser in the Calculate Field tool, the result returned is the value for natural logarithm (ln) instead of the logarithm value. The following image demonstrates the wrong result.
This is an expected behavior when running the log() or math.log() function in the Calculate Field tool. The log() and math.log() functions in ArcGIS Pro are designed to return the natural logarithm to the base irrational number, or e, of the value instead of the logarithm to the base ten (10). Refer to ArcGIS Arcade: Log for more information.
To calculate the base ten logarithm value with the Python parser, use the math.log10() function in the Calculate Field tool.
math.log10(!<FieldName>!)
The following image shows the sample usage and the correct result.
To calculate the base ten logarithm value with the Arcade parser, divide the natural logarithm value by 2.302585 using the following expression.
log($feature.<fieldName>)/2.302585
Get help from ArcGIS experts
Download the Esri Support App