Select to view content in your preferred language

If-Then function for writing a value in column B based on a value in column A

1371
10
Jump to solution
05-27-2020 09:46 AM
RobertHill
Emerging Contributor

Hello All,

I'm looking for a starting point on how to code the following in ArcPy: I need an UpdateCursor to go through every row in my feature class and write a value into a cell based on the value in another cell.  In other words, if I have two fields (RR Type and RR Width), for each row where RR Type = "Two Way," I want to write the value "12" in RR Width.

I know an UpdateCurser is needed and am thinking that I should use an If - Then function, but it's a bit over my head.  I'm still really new to Python.  

0 Kudos
10 Replies
JoeBorgione
MVP Emeritus

Shapefiles are so 1995.  Typically I use File Geodatabase Feature Classes. As far as data storage location, it depends.  Typically on a shared drive, but now that I'm working from home and the VPN is flakey, I keep everything locally.  I create directories under C:\gis

That should just about do it....
0 Kudos