0
votes
1answer
34 views

ArcGis Python Script, Calculate Field

Sorry for my English. I am trying to write a Python Script for ArcGis 10.2. #import system modules import arcpy import math from arcpy import env #Set environment options ...
0
votes
1answer
44 views

Parsing field in field calculator using Python

I have field1 which has a values of "A_B" (example). I created two fields out of this, values to the left of the underscore go in fielda and to the right of the underscore go in fieldb. I used the ...
3
votes
1answer
54 views

Using Python in Field Calculator to compare two fields

I'm trying to use field calculator to compare two fields in a table of tax parcel data, Land Value (LAND_VAL) and Improvement Value (IMPRVT_VAL). My goal is to determine (1) Parcels with land value ...
2
votes
4answers
94 views

Field calculator Python else statement question

The codeblock below is run on Field1 and calculates Field1 to equal Field2 if they are not equal. Else it returns Field1. My question is, does the else statement actually recalculate Field1 to equal ...
1
vote
1answer
75 views

Null value error with Python in field calculator

I'm trying to calculate the angle between two line segments in ArcMap 10.0. I have a point shapefile, so I'm using the xy coordinates of 3 successive points to calculate the angle. I'm trying to use ...
0
votes
1answer
27 views

CalculateField_management - updating fields with X and Y coordinates for start and end of line

I've searched all the help documents and can't see where my script is going wrong. I've tried adding the fields as FLOAT, replacing "PYTHON_9_3" with just "PYTHON" but it just doesn't work. The ...
1
vote
1answer
51 views

Python in ArcGIS, CalculateField_management, updating with single value

I have a float field which I want to simply update all values with 1. I can easily do this within the field calculator but I have started using python today, what is the syntax to simply update a ...
2
votes
2answers
66 views

Conditional field calculator expression

I need to calculate the PIPEID field to equal the G_KEY_COMP field if PIPEID is null or PIPEID and G_KEY_COMP do not match. I think the first condition of the PIPEID being null is covered by the ...
-1
votes
0answers
34 views

Removing the same character from the middle of a string in Field Calculator [migrated]

This is the String I have in one column; CO060020N0650W0. I need it to say 2N65W. The second character is '5', sometimes it's '7'. I want to remove just that character from field calculator. How ...
1
vote
0answers
30 views

How to replace accented strings in attribute tables using Python or VBA ArcGIS 10.2 [duplicate]

I need to replace accented words, into the Field Calculator, to the same non-accented ones. For example: MarĂ­a ---> Maria Need some help with this VB Code: Dim data as integer Dim contador Dim ...
2
votes
2answers
106 views

How to trim strings in Field Calculator?

I am currently working on a County plat book and am in the process of prepping the "Owner_Nm" field that will serve as my annotation layer. I am trying to whittle down the owner names, based on ...
0
votes
0answers
89 views

ArcGIS Python Field Calculation

Ok so i've got a problem with the field calculator in ArcGIS: I'm already pretty far with it since i got some help :P but it still doesnt work. What i've got: -A complete table of several states of ...
-1
votes
1answer
83 views

Error python calculation in field calculator

In a shapefile, I have Field named Elevation with a text field containing integer ranges stored as strings: 1 - 2 3 - 6 2 - 3 8.5 - 12 11 - 12 I need to categorize it using rule that if Elevation ...
2
votes
1answer
77 views

How to Populate new field using expression containing MAX value from another field in ArcGIS attribute table using field calculator?

I've got one field X with 10 numerical attributes (float/double). I've created a new field Y (also float/double) which I need to populate with the percentage of each record/attribute (in each of the ...
0
votes
1answer
98 views

Calculating Stream Length-gradient Index (Hack Index) with the field calculator

I'm trying to calculate the Stream Length-Gradient Index of a stream (example data below). Just started to get into python, but am struggling with a solution to this problem. I have 42 streams to run ...
3
votes
2answers
58 views

How To Determine Percent of Matched Data?

In my attribute table, I have 2 columns with qualitative (categorical) data. Both of them are from different sources so I am trying to find the percent of matched data from these 2 columns. I created ...
3
votes
1answer
80 views

How to find lowest value that is not null using Python in ArcGIS for Desktop?

I have four fields in my table, (A,B,C,D). The field type is double with some fields being NULL. I used min(A,B,C,D) to return the smallest value and it works well if there are no NULL value in any of ...
4
votes
3answers
213 views

How to find/replace element in field with Field Calculator

I just want to perform the following operation done in Matlab into the Field Calculator using Python: p(p==0) = 0.001 ; p(p == 1) = 0.999; tVar = .5*log(p ./ (1 - p)) the operation consists of a ...
3
votes
2answers
484 views

Basic If/Then in ArcGIS 10.2 Field Calculator (Python or VB)

I've been looking through these threads and can't seem to figure out my answer yet. Very new to VBA and Python, but lots of years with Arc.I know I can do this the slow way with Select By Attributes, ...
2
votes
1answer
146 views

How to make autoIncrement number start with (001…009, 011…099)?

i have a challenge with my time in my work, i have feature class called "Parcel" storing many data, i generated an autoIncrement number by using field calculator, in field "parcel code" Expression: ...
4
votes
1answer
64 views

Are Date columns in feature classes stored as python datetime objects?

I have a Date column called readings_measurement_tstamp stored in my feature class. I would like to add a String column to this feature class and Field Calculate it to be be just the %H:%M:%S ...
0
votes
0answers
55 views

Populate a new field with list of the top 5 values of all fields for that record

I have 15 fields. I would like to add a new field that is populated with the field name and value of the top 5 highest values of the 15 fields for each record in the table. The new field would be a ...
2
votes
2answers
94 views

Field Calculator, Conditional

I am trying to assign Value from one field of my Attribute table to a new field based on the 3d field.... The Code Block I am thinking about as follows: *def conditional (!FarmCateg!): if ...
2
votes
1answer
65 views

Populate an attribute table field using the 'startswith function

I am hoping that someone may be able to help me. I am new to ArcGIS, and even newer to Python. Working in ArcGIS 10.1, I have done is created a new text field in an attribute table, which I have ...
4
votes
1answer
87 views

Way to change the default parser in ArcGIS Field Calculator to Python?

Using ArcGIS 10.1 Is there a way to change the default parser in the Field Calculator to Python? So annoying to always change now that I'm trying to move away from using VBScript...
1
vote
1answer
107 views

Help with field calculator in Python script

I am getting a syntax error in my script but I know from testing it in ArcMap attribute table, the syntax is fine. Anyone have any idea why this code doesn't work? I see that a search cursor has been ...
1
vote
2answers
97 views

Using python elif syntax in Field Calculator to reclassify a range of values from a different field and populate a new field

I'm trying to use the Field Calculator with a python elif statement to reclassify values from a different field and populate a new field, and while I'm not getting an error message of any kind, I'm ...
2
votes
3answers
100 views

ArcGIS 10.1 : Returning shape.area in my code block

I try to calculate a field using an 'if' statement in the field calculator. Here is my code : " #Expression MyField_2 = def Reclass(!MyField_1!) #Parser Python 9.3 #Code Block def ...
4
votes
1answer
479 views

Python If else statements

I'm trying to populate a field from another. The catch is that it isn't 1 or 2 values. If my field A = 4 then I want it to return field B to 0. But if Field A is 1, 2 or 3 then I want the user to be ...
1
vote
1answer
108 views

Cursor Update Python Script for Multiplying Several Fields against a Ratio (Real) in ArcGis

Disclaimer: Python Neophyte, Uber-reliant on GUI, working to wean... I have a Python script for replacing multiple Field values with another table value that was graciously provided by the inimitable ...
0
votes
1answer
120 views

Conditional Calculation of a text Field Value Based on antoher text field value ArcGIS10.1 [duplicate]

I Created a new field to explain some zoning codes in an attribute Table. I basically want the new field "Zone" to have a string value based on the field "Zoning" For example if the "Zoning" field ...
2
votes
1answer
122 views

How to assign values to field using if/then logic involving multiple fields?

I want to run a field calculation on a string field named [territory] that first looks at a string field [majr_src] to see if there is a value other than "NONE", if so [territory] = [majr_src]. If ...
3
votes
1answer
1k views

What expressions for QGIS field-calculator?

I do not understand what language I have to use in field-calculator and labels on QGIS: SQL or Python? And where I can find the possible script/expressions to use? in the image you can see the ...
1
vote
2answers
134 views

Using a different projection to calculate areas using the Field Calculator

I have a dataset that is in a WGS84_UTM projected coordinate system, can I force the Field Calculator to use another coordinate system when I use it to calculate areas using pythons ...
1
vote
1answer
73 views

How to correctly use LIKE in the code block of a Reclass expression in ModelBuilder Calculate Field

I have a Reclass expression that works when i am search for single instance of a data field. I also wish the Reclass to work with a SQL type LIKE selection with Wildcards. e.g. I need to reclassify ...
1
vote
1answer
121 views

Python Field Calc for Document Hyperlink

I am trying to create a script that will hyperlink to a .tiff or .pdf. These files are stored in one folder on a shared server. I want the script to look in a field: 'PLAT_IMAGE', which has the plat ...
1
vote
1answer
172 views

remove whitespace Python code results in odd character - Field Calculator

I need to remove whitespace from the end of a string in a field in ArcMap. I tried first the VBA function RTrim, but whitespace still remained. I thought maybe the whitespaces were tabs, so I tried ...
4
votes
2answers
130 views

Can Hyperlink be based on two fields for path and file name separately?

I need to create a hyperlink field. I have one field with the file name, and another field that contains only part of the file path (the real path is unknown). The table contains 14,000 records with ...
3
votes
1answer
263 views

Calculate Field python code has “Expected end of statement” error

I am creating a line shapefile from a csv in a Python (2.7) script. I am assigning an ID field from the csv to a variable and then later using it in the Calculate Field tool. The ID field originally ...
5
votes
2answers
168 views

Field calculator script to work out first 5 dominant area fields?

I have 5 fields of different landcover types with areas of each and found below: > PRC_Water| PRC_Bare| PRC_Urban| PRC_LVeg| PRC_LVeg| > 5 20 40 20 15 I have ...
2
votes
3answers
275 views

Python script for identifying duplicate records (follow up)

I am trying to calculate a field that marks duplicates and sequentially numbers them. I am using the code below that I found here: Generating sequential numbering for duplicate values in a field ...
1
vote
0answers
375 views

Using multiple fields for a Reclass calculation in ArcGIS Field Calculator [closed]

I am trying to create a dummy variable from an existing dataset using ArcGIS's Field Calculator tool with a Python script. My conditions require the use of multiple fields to determine the output ...
5
votes
1answer
266 views

Translate Excel formula to be used in field calculator

I have a series of equations to create corner points to make rotated polygons based on angles in the attribute table, but I have created it in excel and can't figure out the syntax to get it to work ...
0
votes
1answer
91 views

Python: using CalculateField_management for duplicating attributes with a double quotation mark

I am writing a python script which duplicates a field. The field contains names of pipelines but some of these names has double quotation (ex. 8" NGL PIPELINE). I have created a new field and trying ...
0
votes
2answers
157 views

Field Calculate with a function written in python within a larger python script

I'm writing a python program where I need to field calculate using a python function. The function takes two strings; one used for an if statement and the other to become an integer complete a simple ...
2
votes
1answer
270 views

How to use Field Calculator to calculate area as percentage?

I am searching for python code to use in Field Calculator to calculate area as a percentage in relation to another field? The area percentage needs be calculated based on the total area for each ...
2
votes
1answer
126 views

Using Sum() or something similar with CalculateField_management and FieldLists

I need some help with using variables with CalculateField_management tool. I've tried several different scenarios but don't seem to have any luck. What I have is a list of fields containing water ...
1
vote
1answer
112 views

Compare field values and assign a new field to store value ArcMap 10 python

I am currently doing an analysis in Arc Map 10 using python, as I am not familiar with this tool, hence I come here to ask your help. I actually have two shape layers, one is a point layer and the ...
3
votes
3answers
144 views

Count the number of characters in a field (Python)

I have a field that contains street names and a second field called COUNT. I need to perform a Python field calculation on the COUNT field that counts the number of characters in the STREET_NAME ...
0
votes
0answers
51 views

using Field PyCulator to input data in PostGIS layer

I'm triyng to input data in a prymary key field of a PostGIS layer, using the GID, a string field for codification (), and a text ("NH"). But I don't know how to make it works under Python! (Q GIS ...