14 - Updating Multiple Fields - ArcMap Scripting with Python and Arcpy

preview_player
Показать описание
Learn how to use Python and Arcpy with ArcMap

Рекомендации по теме
Комментарии
Автор

2023, those videos are still inspiring tutorials. Good stuff, thanks Franchyze!

wj_desmond
Автор

Hello Fran, thank you so much for creating these videos! They are very helpful. Since you mention at the end of the video that we can write you suggestions about future videos, here is mine: create a video about arcpy & Python that uses frequently used operations: intersecting, merging, clipping, erasing, reprojecting, calculating some statistics (for example, mean), exporting to Excel.

ivamihaylova
Автор

These are great videos I just want to add for anyone new to python, its not necessary to use the 2nd 'for' loop with the Updatecursor.
We can just pass list_field directly.

The error occurs because list_field is already a list and doesn't need to be put in the list brackets []

with arcpy.da.UpdateCursor(points, [list_field]) as city_cursor: <- this causes an error

with arcpy.da.UpdateCursor(points, list_field) as city_cursor: <- this should not

Also python has something called list comprehension so list_field can be created with 1 line:

list_field = [field.name for field in field_list if field.type == 'String']

johnkent
Автор

dude, these videos were fucking awesome. Helped so much. Thank you!!

royapostle
Автор

I've just gone through your videos in this list. They are great helpful. ^^

margueritjia
Автор

these videos were fucking awesome. I really want to Python for Arcgis. Hope that you give a lot Arcgis Scripting with Python

nguyenvanchanh
Автор

How would you go through and update one field based on another? For example, each row has a longID field and a shortID field, and I want to use the longID field to update the null/blank shortID field (001)?

ryanhowell
Автор

We can use this way too, it is easier :


import arcpy

arcpy.env.overwriteOutput = True
arcpy.env.workspace = r'D:\UNT\GIS\Python\Data'
points =

myList = arcpy.ListFields(points)
for element in myList:
print element.type
if element.type == "String":
with arcpy.da.UpdateCursor(points, [element.name]) as cursor:
for element1 in cursor:
if element1[0] == " ":
element1[0] = "Papppa"
cursor.updateRow(element1)

mrnikfal
welcome to shbcf.ru