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:
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.
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 (0000001) to update the null/blank shortID field (001)?
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 = r'D:\UNT\GIS\Python\Data\PointSample.shp' 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)
2023, those videos are still inspiring tutorials. Good stuff, thanks Franchyze!
You’re welcome! Glad they are still useful
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:
please can you explain further
@@abdulrashidhassan7649 what part are you having trouble with?
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.
dude, these videos were fucking awesome. Helped so much. Thank you!!
Thanks! Glad they were helpful.
I've just gone through your videos in this list. They are great helpful. ^^
Thanks for watching!
Really helpful series!!
Thank you!
these videos were fucking awesome. I really want to Python for Arcgis. Hope that you give a lot Arcgis Scripting with Python
Great job! Thank you Fran!
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 (0000001) to update the null/blank shortID field (001)?
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 = r'D:\UNT\GIS\Python\Data\PointSample.shp'
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)