Select to view content in your preferred language

Python and Parcel Data

08-09-2016 09:59 AM
New Contributor II

My Python is a bit rusty at this point and what I thought was a simple script has me hung up for some reason.

I have table of parcel data which includes "qualifiers" noting whether or not a particular record is a condo, a billboard, or cell tower for instance.  For the purposes of an analysis I would like to perform, I have added a new "Yes/No" field which is to simply note whether or not a particular record is a condo.  Here is the rub.  The 'qualifier' for each condo unit has a unique number as a part of the string, meaning that it doesn't simply have a "C", it can be "C007K" or "C127U".  No qualifier is duplicated when it comes to condos.

I need a python script that will recognize that first character in the string as a "C" and subsequently note a "Yes" in the new field I have added to the table.

Any help you folks can throw my way would be great.  If not, a smack in the head to jog my brain!

0 Kudos
3 Replies
MVP Emeritus

>>> a = "C001"

>>> a[0] == "C"


Regular Contributor III

In addition to Dan this may also help UpdateCursor—Help | ArcGIS for Desktop

0 Kudos
Esri Contributor

No python needed. write a definition query or select by attribute ' field LIKE "C%" ' and run field calculator