All Questions
Tagged with cursor attribute-table
27 questions
1
vote
1
answer
66
views
Duplicating records by using column delimiter in ArcGIS Pro
In ArcGIS Pro 3.3, I have a shapefile where I need to create duplicate records (while preserving geometry per duplicated record) based on the values in a column. The table is structured similar to ...
0
votes
1
answer
45
views
Using search cursor or select for related table data in ArcPy
I am very new to ArcPy and code.
I have about 600 zones that overlay ~8000 different census blocks, which have been divided so that census blocks that aren't fully inside a zone are split, meaning ...
1
vote
3
answers
244
views
Updating first occurence of duplicate with lowest value in given field using ArcPy cursor
I have a few hundred GPS data points (saved in an ArcGIS Pro 2.9 file geodatabase) that logged simultaneously with different speeds. I am looking to write a Python script that will compare each row's ...
0
votes
1
answer
68
views
i want to create a layer with two different value of a field [closed]
I want to create a layer with two different value of a field.
Suppose I have a layer named "Road Network". In that feature class i have a field in attribute table named "addi_rd"......
2
votes
1
answer
40
views
Replace a field with maximum of it's attribute values based on values repeated on another field's attribute values using ArcPy
So I have performed Spatial Join between a point and line feature class. Now for each point there are several lines. What I want is the maximum count of line features as an attribute value in the &...
1
vote
1
answer
88
views
Delete fields from a table based on Mean calculation using ArcPy
I have an attribute table with 100 columns (values are float and not NULL; more than 3000 rows). Using ArcGIS 10.6
I want to calculate the mean value of every field in a shapefile separately (like ...
0
votes
1
answer
2k
views
Using arcpy.da.SearchCursor to sort field in attribute table by ascending order
I am using ArcMap 10.6 with Python 2.7.14 with ArcPy.
I want to sort a field named Seq_ID in my attribute table by ascending order using ArcPy.
I believe I have to use arcpy.da.SearchCursor.
Here is ...
1
vote
1
answer
320
views
Python scripting (update cursor, extract previous row values)
I am new to Python scripting.
I would like to use SearchCursor to iterate in each row using the FID as index. Then I would like to evaluate length based on the following conditions:
If the length >...
1
vote
2
answers
238
views
Transferring Data From One Table to Another Using Multiple Keys in ArcPy?
I have data in one field and I want to transfer it to a specific field in another table based on specific keys Such as ID, road_type and veg_type.
My original table looks like this
ID Road_Type ...
1
vote
1
answer
1k
views
How do I insert a list of values into individual rows using Python?
I have a dataset that contains a field with a range of numbers (e.g. 1, 2, 3-6) as well as other fields. I've used python to expand the range field into discrete numbers (e.g. 1, 2, 3, 4, 5, 6) stored ...
2
votes
2
answers
1k
views
Change specific rows in attribute table using Arcpy in ArcGIS 10.3
I need to change values in field "name1" (string field) in specific rows: 70-72 into "no land use" value. I search Arcpy code to do it.
i red How to select specific row in attribute table using ...
0
votes
1
answer
84
views
write values to raster table
I am working with a .tif raster which has an attribute table. I can successfully add a number of extra fields, however I am having problems populating those fields.
When I add the updateCursor part ...
1
vote
1
answer
200
views
Assigning fishnet attributes by row instead of by column with ArcPy?
I created a fishnet grid and assigned numeric attributes 1-16 to a new field using the arcpy.da.UpdateCursor function. It however assigned the attributes north to south (see image).
How can I change ...
1
vote
1
answer
577
views
Changing field values selected attributes of shapefile in ArcGIS desktop?
I have nine fields in a shapefile and want to use Python to change the values of those fields. The value would be given by the user.
The attributes selected would receive the input value each time ...
2
votes
1
answer
2k
views
Adding values from list to field in feature class using ArcPy?
I have the code below. fc is a shapefile. I add a new field called "RANK". I want to populate the RANK column with values from Final_Rank list. Fortunately, they are of the same size. Field RANK has ...
2
votes
1
answer
1k
views
Updating a table with the changes made from another table
I am trying to do updates to a source table from another table that has a like field (propertyid). I am trying to update all of the fields in the source table. I have gotten the outcome I want with ...
1
vote
1
answer
1k
views
Python - Date notation to MM/DD/YYYY
I'm a complete beginner trying to update some fields in an attribute table (i.e. an ArcMap Shapefile) using Python tool. My goal it to update the values from this column to another date notation.
...
0
votes
1
answer
111
views
Arcpy/CSV module extract many columns from GDB table and write to csv
Below is part of a script i wrote a few months back when I was still learning python. Its part of a larger script, its works totally fine but it is really clunky and not 'pythonic'. It is pretty ...
3
votes
1
answer
6k
views
Creating tables on ArcGIS with arcpy?
I'm using python scripts on ArcGIS 10.2 to read excel files with information and put this results on attribute tables of the ArcGIS.
I know how to create a table, add rows, add fields and send ...
1
vote
1
answer
428
views
Arcpy.da.SearchCursor() help when attribute doesn't exist
I'm updating text elements off of an arcpy.da.SearchCursor script and needed to construct the script to return a response for when the attribute does NOT exist. Here is the snippet of the code THAT ...
3
votes
2
answers
314
views
Search for textbits in QGIS
Is there a way to search for only parts of text in QGIS.
Imagine I have a field in my attributetable called myField and I have several entries there, something like
This is awesome
Even more awesome
...
1
vote
1
answer
666
views
How to update new column in attribute table with same values but different field type?
I am struggling a bit with debugging my code, over something that seems very simple. I am using an update cursor to copy and convert existing string data into a new float column of my shapefile's ...
0
votes
0
answers
36
views
Multiple Together Several Fields, then Use Update Cursor
Is it possible to preform multiplication on several fields of an attribute table together and then use an update cursor to assign the resulting value to a specific field?
3
votes
2
answers
137
views
Removing values from shapefile with ArcPy?
I have a large shapefile with lots of duplicate records. However, each duplicate record has an accuracy rating. I want to remove all duplicate records with a lower accuracy rating.
This would be ...
1
vote
1
answer
872
views
Stuck updating one field based on the condition of another using Acrpy or Field Calculator
I have a shapefile with 5,000 city points. I need to populate a new field, "cls_pop", based on each cities population, so that cities with a population > 2,000,000 will have "cls_pop" = 1, cites with ...
12
votes
1
answer
2k
views
Fastest methods for modifying attribute tables with Python?
A while ago, I wrote a quick Python function for converting an attribute table to a python dictionary, where the key is taken from a user-specified unique ID field (typically the OID field). ...
2
votes
1
answer
792
views
Updating and inserting a field within the same loop
I am working with an empty feature class where I am writing a script to create polylines within the featureclass and attach an associated text value with the polyline.
I am using a for loop as noted ...