Skip to main content
naming
Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

How to avoid default_value in field with arcpyArcPy cursor (e.g. row[i]=None)?

English usage
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

Some field in field_list has default_value=1 After executing the following code, such field is filled with the value «1», but normal fields are filled «Null». Could meHow could I avoid this for the fiedfield (default_value=1) and write there «Null»?

with a.da.UpdateCursor(table, field_list, where_clause) as cursor:
    for row in cursor:
        for i in range(0, len(row)):
            if row[i] == 0:
                row[i] = None
        cursor.updateRow(row)

Большое спасибо! :)

Some field in field_list has default_value=1 After executing the following code, such field is filled with the value «1», but normal fields are filled «Null». Could me avoid this for the fied (default_value=1) and write there «Null»?

with a.da.UpdateCursor(table, field_list, where_clause) as cursor:
    for row in cursor:
        for i in range(0, len(row)):
            if row[i] == 0:
                row[i] = None
        cursor.updateRow(row)

Большое спасибо! :)

Some field in field_list has default_value=1 After executing the following code, such field is filled with the value «1», but normal fields are filled «Null». How could I avoid this for the field (default_value=1) and write there «Null»?

with a.da.UpdateCursor(table, field_list, where_clause) as cursor:
    for row in cursor:
        for i in range(0, len(row)):
            if row[i] == 0:
                row[i] = None
        cursor.updateRow(row)
Source Link

How to avoid default_value in field with arcpy cursor (e.g. row[i]=None)?

Some field in field_list has default_value=1 After executing the following code, such field is filled with the value «1», but normal fields are filled «Null». Could me avoid this for the fied (default_value=1) and write there «Null»?

with a.da.UpdateCursor(table, field_list, where_clause) as cursor:
    for row in cursor:
        for i in range(0, len(row)):
            if row[i] == 0:
                row[i] = None
        cursor.updateRow(row)

Большое спасибо! :)