I have an attribute table for a shape file, that has the attributes for a number of polygons. I have created a new field, that I need to have values of 1 or 0, based on whether there are attributes present in a different field. This is all being conducted within the same attribute table.
You can easily do this using Field Calculator and a little python code. Assuming you are using ArcGIS Desktop 10.x, please take a look at Calculate Field examples—Help | ArcGIS Desktop.
You would create a function such as below using def statement in the call block then call the function. This example checks for None or Null values and returns 0 if found or 1 if not. This can be customized to meet your needs or to address empty strings or specific values.
def checkAttrib(field1):
if field1: #this will return "0" for None or Null values or "1" for most other values
return 1
else:
return 0
The function is called using:
checkAttrib(!Field_Name_to_Check!)
The code can be further expanded to check multiple fields and return different values. You can modify the if statement to check for a specific value or if the value is in a list.
if field1 == "abc":
or
if field1 in ['abc', 'xyz']:
Or if you're using ArcGIS Pro, note that there is a Helper called Reclassify which would give you a template that you can modify: