Skip to main content

Questions tagged [python-parser]

For questions about ArcGIS Python Parser for labelling expressions and field calculations

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 views

Getting Error from ModelBuilder (calculate values)

I want to remove the last 7 character from parsepath (%Value%) what is wrong with this code?
Arda's user avatar
  • 3
0 votes
0 answers
31 views

How to give numbers by order to column in ArcGIS Pro through FieldCalculator and Python

How to give numbers by order to column in ArcGIS Pro through FieldCalculator and Python? Sequence doesn't work as I need. I sorted X_North and need to give a numbering (from 1 to 296) to new column. I ...
Sandi's user avatar
  • 17
0 votes
1 answer
47 views

Ignore labeling when field has specific word - ArcMap 10.8

Looking to add a function of my labeling expression to not label feature with the word 'TO". For example, some roads are named '5th TO I-10'. I am using Python as the parser with advanced checked....
AFang's user avatar
  • 3
0 votes
1 answer
46 views

Field Calculator populating a new field with strings based on old field with integers

I have two fields, one is old, Ftype, one is new, Ftype_name. I would like to have python read the numbers in Ftype and populate Ftype_name with the string. I used to know how to do this before they ...
R. Ian Cunningham's user avatar
1 vote
1 answer
68 views

Conditional Label Expression in ArcGIS Pro

I have a set of wells I am trying to label with contaminant data using python. I'd like the well name and constituents stacked but also formatted a certain way. This is what I have so far: def ...
Jeff Fitzgibbons's user avatar
0 votes
0 answers
56 views

Calculate Field calculates once

Why did Calc Field work the first time I wrote the following code, but not when I re-ran it with an additional criteria? I figured out the code I needed to classify all fields in a new attribute ...
Ryan Stephenson's user avatar
1 vote
1 answer
78 views

Using ModelBuilder in ArcGIS Pro

I am trying to create a ModelBuilder model to calculate factor of safety for shapefiles. However, whenever I try to run the python my 'Slope' comes up as undefined and I have no clue what to do. Here ...
Matt's user avatar
  • 11
1 vote
1 answer
87 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 ...
Arthur_Morgan's user avatar
0 votes
1 answer
58 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, ...
Androoo's user avatar
1 vote
1 answer
96 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 ...
ArcheoHorst's user avatar
0 votes
1 answer
74 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 ...
Arthur_Morgan's user avatar
2 votes
1 answer
94 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, ...
Laura's user avatar
  • 21
0 votes
0 answers
120 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: ...
Mohammad Hosseini's user avatar
1 vote
1 answer
49 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"'] ...
Average_LukeGIS's user avatar
1 vote
1 answer
77 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,...
GBG's user avatar
  • 9,969
-1 votes
1 answer
63 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:
Mason's user avatar
  • 17
2 votes
1 answer
90 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 ...
JTstone's user avatar
  • 37
1 vote
1 answer
287 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 ...
JTstone's user avatar
  • 37
3 votes
1 answer
280 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 ...
Ghaith's user avatar
  • 33
0 votes
3 answers
169 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 ...
ncwxpanther's user avatar
0 votes
1 answer
177 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 ...
Gwen Zarko's user avatar
0 votes
2 answers
242 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 ...
Ms05's user avatar
  • 125
0 votes
0 answers
51 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 ...
LandArch's user avatar
  • 2,201
0 votes
1 answer
75 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 ...
annag's user avatar
  • 84
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 ...
Jennifer S's user avatar
1 vote
1 answer
243 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 '...
rpenman's user avatar
  • 33
0 votes
1 answer
1k 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 ...
mil's user avatar
  • 11
0 votes
0 answers
208 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 ...
GISLad's user avatar
  • 11
-1 votes
1 answer
146 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. ...
Matthew Aldrovandi's user avatar
2 votes
1 answer
225 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, ...
Seth's user avatar
  • 23
0 votes
2 answers
282 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 ...
rweber's user avatar
  • 51
1 vote
0 answers
215 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 ...
BoniPhila's user avatar
0 votes
2 answers
168 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 ...
Steve's user avatar
  • 773
0 votes
1 answer
259 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 ...
Dilshad Raza's user avatar
2 votes
1 answer
197 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 ...
NotLuckyLuke's user avatar
1 vote
1 answer
131 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 ...
Adam 's user avatar
  • 43
2 votes
0 answers
199 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 ...
Ryan's user avatar
  • 21
1 vote
0 answers
109 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:...
RCWO's user avatar
  • 11
2 votes
1 answer
70 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 ...
mrmcbreakfast's user avatar
1 vote
1 answer
398 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 ...
User1974's user avatar
  • 1,132
1 vote
0 answers
29 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 ...
Alex's user avatar
  • 11
2 votes
3 answers
326 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 ...
cerroGIS's user avatar
2 votes
1 answer
318 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 ...
arc_user's user avatar
2 votes
1 answer
42 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 ...
Maqsooda Mahomed's user avatar
1 vote
2 answers
101 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 ...
Jan's user avatar
  • 31
0 votes
1 answer
452 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( !...
arc_user's user avatar
-2 votes
1 answer
730 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 ...
Olivia W's user avatar
3 votes
1 answer
262 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 ...
Narpity's user avatar
  • 61
-2 votes
1 answer
219 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
amir's user avatar
  • 1
2 votes
2 answers
653 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" ...
Yogesh Chavan's user avatar

1
2 3 4 5
14