Questions tagged [python-parser]
For questions about ArcGIS Python Parser for labelling expressions and field calculations
678
questions
1
vote
1
answer
23
views
Add sequential ids to a column using calculate field
So I have a bunch of ObjectIDs that have null id values. These null values start from ObjectID 20866 to 21899. ObjectID 20865 has id value 30542 so the next id value for ObjectID 20866 would be 30543 ...
0
votes
1
answer
46
views
Field Calculator If Statement
I am new to python and was trying to populate a decade field based on an if else statement on another field that contains parcel years.
The code block is below:
def ifBlock(Parcel_Year_Built, ...
1
vote
1
answer
37
views
Using ArcGIS Pro field calculator: check values one column and enter specific data in a second column
I have two fields and I want to use field calculator to check the column Datierun_1 (alias is Datierung) for certain words (in this case "Achaemenid"). In case it finds a match it should ...
0
votes
1
answer
46
views
Populating field based on value of another field using Boolean OR [closed]
I am trying to enter values for a new column, FloodZone, based on another column's (NEW_ZONE) values. I am doing this in ArcGIS Pro 3.1 using the Calculate Field Tool via Python. However, I am getting ...
2
votes
1
answer
48
views
Using Python to change Callout Outline color in ArcGIS Pro
I am using ArcGIS pro to create some maps. There is a polyline feature layer where all of the important data comes from, which is determined by the fields "Direction" with domain of North, ...
0
votes
0
answers
75
views
How to convert the RGB color model to the HSV color model in ArcGIS Pro
How to convert the RGB color model to the HSV color model in ArcGIS Pro with Python parser?
I'm trying Calculate Field Tool, everything seems correct but it doesn't work!
Method (1)
Code Block:
...
1
vote
1
answer
42
views
ArcMap Label (Python)
SOLUTION: I was able to do it with help of a colleague by creating a list instead, I'm assuming the tuple was was a quirky bug;
def FindLabel ( [PIPE_INTERNAL_DIAMETER] ):
lst = ['1"', '2"']
...
1
vote
1
answer
43
views
ArcMap field calculator expression failing with ERROR 000539 [closed]
I am using ArcMap 10.7.
I have an attribute table with 6 different columns of short integer data. These columns store the birth day, birth month, and birth year, as well as the death day, death month,...
-1
votes
1
answer
40
views
ERROR 000539 when trying to calculate a field and using code block [closed]
I was given these instructions for an assignment:
However when I am trying to calculate the field I keep getting this error:
I am trying to calculate the field to get something like this:
2
votes
1
answer
83
views
Moving large set of points to new lat/long using python in field calculator - ArcMap
I'm using ArcMap 10.6.1. I have a large set of points I am trying to move to a new Lat/Long based off of two new fields (X2 and Y2) joined from another table. I have been researching this question for ...
1
vote
1
answer
148
views
Calculate distance between two sets of x & y values into a new field using ArcMap Field Calculator and Python
I am a novice when it comes to python. I am working on creating a new field that has the distance between two sets of x & y values.
I've joined two tables so I have each of their x y values in the ...
3
votes
1
answer
265
views
ArcMap Field Calculator Python Parser gives ERROR 999999
I am trying to assign values to a "K" field in an attribute table based on the "gridcode" values. However, I get this error:
"ERROR 999999: Error executing function.
The ...
0
votes
3
answers
121
views
Adding two or more fields based on condition and reclass sum in existing field using ArcPy with ArcGIS Pro
I have a table that contains data that needs to be summed and the result needs to replace an existing value. I only want to sum the values if they are not -9999. The result would be put in the ...
0
votes
1
answer
121
views
Using If then statements in Python Parser of Field Calculator using ArcGIS Pro
I was trying to write and if calculation and I cannot figure out the syntax to complete it.
The one on the left doesn’t work as it will return the text of the calculation I am trying to perform ...
0
votes
1
answer
197
views
ArcGIS Pro: Calculate Field function to do multiple string calculations in one code block
I need to strip leading and trailing whitespace, split string into list to remove excess whitespace between words and uppercase all values within one Python code block and calculation in Pro field ...
0
votes
0
answers
46
views
Recalculate a Field with data from another field, ignoring NULL values (take two!)
I am having an issue populating a field with data in a secondary field in ArcMap using the field calculator, below is what I put together...
I have a Feature Class in a Geodatabase with a field for ...
0
votes
1
answer
60
views
Calculate Field if/else statement returns nothing
I have to generate line dimension annotation for our maps as a part of my daily workflow. As it stands, I've been using
round(float(!Distance!), 2)
for straight lines, then switching the selection in ...
0
votes
1
answer
43
views
How to calculate fields to search data within a set of unique identifier from another field
I want to know how I should go about coding this table to get the 'context" score for each unique identifier (UI). Each unique identifier has a polygon with non remnant area, remnant area and ...
1
vote
1
answer
159
views
Search for partial string in multiple fields, return full string to new field using Field Calculator of ArcGIS Pro
I am attempting a field calculation that searches multiple fields for a partial string, but returns the entire string of the field containing the partial string. For example, the partial string '...
0
votes
1
answer
853
views
Calculate Field in ArcGIS Pro with autoIncrement based on another attribute [duplicate]
I want to use Calculate Field in ArcGIS Pro to count up sequentially, but start over with each new group. The groups are defined by FEATUREID.
Example of desired output:
FEATUREID GEOMETRYID
A ...
0
votes
0
answers
150
views
Using Parse path to remove extension in model builder. ERROR 000354: The name contains invalid characters
I am trying to iterate through a folder of rasters (approx 6,000) and calculate zonal statistics for roads/paths throughout GB that intersect with raster pixels. However, I am unable to generate an ...
-1
votes
1
answer
107
views
Getting failure in Calculate Field
After today's SW update I keep getting this failure, not sure why, but I am thinking it's the expression. I have no idea how to change the expression to something that makes sense if that's the issue.
...
2
votes
1
answer
189
views
Field Calculator for Multiple Fields
I am trying to get field calculator to work on 2 fields with multiple lines.
Trying to have anything within RS10/R10 > 100,000 to return 1 if not then 0, also same results RS15/R15 > 150,000, ...
0
votes
2
answers
263
views
Iterating through Calculate Field using ArcPy
I have three shapefiles as points that I am trying to create new fields for and fill in the fields with a string descriptor. I am then trying to merge all three point files deleting every field but ...
1
vote
0
answers
180
views
Trying to calculate a field with code block but it is not filling the fields [closed]
I am using ArcGIS Pro calculate field. With this I want to fill the null values of a new field from another field using if and elif statements. The other field is "yearsINT" which is a short ...
0
votes
2
answers
161
views
Populate NULL from existing value from another record
I'm using ArcGIS Pro on the table below (ACCT_ID field is sorted). The goal is to calculate/populate the "Asset" field where if rows have the same "ACCT_ID" and at least one of ...
0
votes
1
answer
235
views
I need label expression in python to stack labels for points present at same geometry
I have a data set that has stacked points. I need to display the labels as one. The dataset has locations that only have 1 point and some that have 2 or 3 stacked points. I’d also like to be able to ...
2
votes
1
answer
171
views
ArcMap - Date field
I am trying to append some data to an existing enterprise geodatabase feature class, the data I am trying to append has a date field where some entries are in correct, eg instead of 03/19/1983 they ...
1
vote
1
answer
116
views
Selecting attributes for field calculator by common name
I am trying to automate some of my GIS processes and have come across a snag in my automation. I am trying to understand the percent coverage of my suitability raster layer with my town boundaries ...
2
votes
0
answers
150
views
Combining labels for multiple points in ArcMap
I have a data set that has stacked points. I need to display the labels as one. I've seen this solution Can labels for overlapping points be combined/merged into one label? but it only works for a ...
1
vote
0
answers
100
views
ArcGIS Pro field calculator based on values code [closed]
I'm trying to calculate a field to produce symbol codes for GPS units based on a field "Grade". I've tried cobbling together the code based on samples I found; but got syntax error.
The Code:...
2
votes
1
answer
58
views
Amalgamating zip codes using Python Parser of ArcGIS Pro Field Calculator
I'm fairly new to Python and I'm trying to amalgamate the zip codes from the fields of !OWADR2!, !OWADR3!, and !OWADR4! into a new field I've created. Basically I want to make a block of code in the ...
1
vote
1
answer
330
views
Conditionally skip field calculation for certain rows
Regarding the field calculator in the ArcGIS Pro 2.9 attribute table (Python):
Is there a way to skip calculating a certain record, if certain conditions are met in the script?
For example, if the ...
1
vote
0
answers
26
views
Populate/reclassify newly created field with values dependent on an existing field
I'm trying to populate/reclassify a newly created field with values dependent on an existing field. The new and exiting field has text data type.
Here is the code that I'm using. The existing field is ...
2
votes
3
answers
283
views
Calculate Sequential Values based on Boolean field
I am trying to calculate sequential ID Values (SeqID) based on Boolean field (Boolean) along several rows in attribute table through the field calculator of ArcGIS Pro, Python, (expression and ...
2
votes
1
answer
224
views
Finding duplicate attributes and selecting one to delete based on another column
I have a very large polygon attribute table with multiple pairs of duplicate superimposed polygons, whose areas are identical. There is also another column which indicates the years these polygons ...
2
votes
1
answer
38
views
Assigning different classes using ArcGIS Field Calculator
Below is the code with what I have come up with. I have two columns, one named First_kopp that have the classes CT, WT, ST ranging from 1-9, and the second column is named First-fros. There are ...
1
vote
2
answers
76
views
Calculating ratio between 2 different area polygons in each cell of a given polygon grid using ArcGIS Pro
I'm trying to calculate the ratio of the areas of 2 polygons (Sealed Surfaces and unsealed Surfaces) in each cell of a given polygon (fishnet) grid. The areas are in one featureclass and I also ...
0
votes
1
answer
383
views
Field Calculator Python code error - "Parameters are not valid"
I am trying to create a new column that combines the values of two other columns for display purposes. Here is the code that I am trying:
"Pre-Logic Script Code" window:
def reclass( !...
-2
votes
1
answer
595
views
Writing IF THEN string calculation in ArcGIS Pro [closed]
I am attempting to calculate a text field in my attribute table based on a number code given in a different column
For example, any number under the "LU_1" column that is '510' will be ...
3
votes
1
answer
210
views
Field Calculator function caused all my rows to become Null
Had a field that had some categories that didnt make sense to be listed alphabetically so wanted to add a preceding number to the text so they would be in the order I wanted. Ran it once and it worked ...
-2
votes
1
answer
198
views
Separating characters using Python Parser of Field Calculator in ArcMap [closed]
How can I separate the characters of a string, for example, three by three with slash letters or dashes and insert them in the Attribute table in ArcMap?
abc-def-gh
a100-b200-c300
2
votes
2
answers
516
views
Removing characters using field calculator in ArcMap
I am working with automating a workflow using ArcGIS ModelBuilder, and the final output returned an error in the resulting output.
Here the Test field is filled by adding a Prefix "City of" ...
0
votes
0
answers
228
views
Syntax for Field Calculator in ModelBuilder of ArcGIS Pro
I'm migrating a legacy ModelBuilder tool that has a VB code block in it to ArcGIS Pro 2.9.
It's a straightforward issue:
The model runs a Calculate Field process. If the field is not null, do nothing,...
1
vote
1
answer
428
views
Replacing text in label through expression in ArcMap
I am using ArcMap.
In the labels I want to alter the text that is displayed, I do not want to change the data in the attribute table.
In the label expression I add the following after checking the ...
0
votes
0
answers
60
views
ArcMap Field Calculator Expression for Highest Value + 1
I'm looking for a VB or Python field calculator expression in ArcMap that will calculate the Highest Value + 1 into the same field named Corr_ID. I was thinking something as simple as this max(!...
0
votes
0
answers
201
views
ArcGIS Pro Python Labelling Expression does not update labels
I am trying to alter the size of labels around a point layer using a python if/elif expression. The expression is valid but nothing changes when I apply the expression. Below I have included the code ...
2
votes
1
answer
38
views
Why does = not seem to be working in script?
Below is the script I am working with. However, I get N/A for values which should have a statement as the output. I have added the screenshot showing the N/A that the script produces instead of the ...
0
votes
0
answers
42
views
Why does script output blanks at certain rows?
I have been trying to run a script, which runs successfully. However, when using the select by attribute tool and choosing get unique values, I have noticed there are certain rows that do not produce ...
2
votes
1
answer
652
views
Calculate Field: Remove last character in string based on condition
I have a list of route numbers in a geodatabase that contain directions on the end of them (123W, 123E, 1500S, etc.). I need to remove the last digit if it is N,S,W,E but leave other letters.
I'm very ...