Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For questions about ArcGIS Python Parser for labelling expressions and field calculations
0
votes
Using If Statements in ArcMap Field Calculator
Esri Support provide an How To: Use IF statements in the Field Calculator:
Summary
The Field Calculator uses IF statements to calculate new values in the
field of an attribute table. This article des …
2
votes
ArcPy expression syntax in CalculateField_management
To do this I would use two Python string methods (format and zfill).
I find workflows like this much easier when approached using arcpy.da.UpdateCursor() rather than the CalculateField_management() fu …
3
votes
Converting full road names to abbreviation using ArcGIS field calculator?
If you only want to use the abbreviations for labelling then you could investigate Using an abbreviation dictionary and the About abbreviating and truncating words page:
Abbreviation dictionaries …
0
votes
Accepted
Converting Angles in a File Geodatabase Table - via Field Calculator's Python
This statement:
def Calculate(NearAngle):
creates a variable named NearAngle but this code:
if ( [NEAR_ANGLE] < 0 and [NEAR_ANGLE] > -180):
[NEAR_ANGLE] = [NEAR_ANGLE] +360
return [NEAR_ …
1
vote
ArcGIS Field Calculator for changeable 3 fields add from table parameter at model builder an...
There is no ArcPy function named GetParameterAsFloat.
You will need to use arcpy.GetParameterAsText() (or possibly arcpy.GetParameter()).
Using print() statements to show what values have been passe …
3
votes
ArcMap Field Calculator Python string concatenation malfunction
Your Python code seems valid because when I run:
def AutoSchluessel(gmk, zae, nen):
return "{}0{}{}".format(gmk, str(zae).rjust(7,"0"), str(nen).rjust(5,"0"))
gmk = 5902
zae = 32
nen = 17
fl …
0
votes
Accepted
Python parser of ArcGIS Field calculator returns ERROR 000539: Error running expression?
On a question such as this, where you have described what appears to be a reproducible bug, and has been verified by another member of our community, I think the best way forward is to log it with Esr …
3
votes
Using ArcPy to multiply fields in attribute table?
I think the easiest way to learn "how to use ArcPy to run a field calculation" is to:
Go to the Search window and find the Calculate Field tool
Open its tool dialog
Configure a test calculation and …
1
vote
Extract characters from an existing string field to create a new field
As commented by @FelixIP this can be done in:
VB syntax mid(field,16,3)
and as commented by @faith_dur:
it is much nicer and versatile in Python, i.e. field [16:19]
1
vote
Accepted
Field calculation based on the field name by using arcpy
You seem to know how to do this in the ArcGIS Field Calculator.
Instead, do exactly the same thing using the Calculate Field tool, taking care to set your parser to Python.
Once you have run the too …
1
vote
ArcGIS Python Field Calculation says failure during processing?
I think the cause of this, and the reason you are also having trouble formatting this correctly in the question, is that there is a colon missing after else.
Try this:
def reclass(a):
if (a <= 5 …
3
votes
Accepted
ERROR 000539: Invalid Field !FULLNAME
The first thing that I would check is whether your feature class has a field called FULLNAME.
The error message that you are receiving suggests that it does not.
3
votes
Python not appearing as option for parser in label expression dialog of ArcGIS Desktop 10.0?
The Python Parser for Label Expressions only became available at ArcGIS 10.1 for Desktop:
New Label Expression parser
At ArcGIS 10.1 there has been a new label expression parser added. You
…
2
votes
How to get around "The field is not nullable" error?
To avoid a divide by zero error I would try changing:
import math
def GetAzimuthPolyline(shape):
radian = math.atan((shape.lastpoint.x - shape.firstpoint.x)/(shape.lastpoint.y - shape.firstpoint …
1
vote
Referencing external CSV file within ArcMap field calculator using python codeblock?
Yes, as @Fezter commented:
if you wanted to you could import the csv module and read the file
that way
but I think it would be easier to just use the Join Field tool:
Joins the contents of …