Question: How can I delete a row in a table if value A from Field 1 does not match value B from Field 4 ? 

I attempted to use code from a previous post as I figured it would be a start but didn't work. 

[![enter image description here](https://i.stack.imgur.com/OmHUC.jpg)](https://i.stack.imgur.com/OmHUC.jpg) 

```
import arcpy
shp = r"C:\path\to\your\shapefile.shp"
rows = arcpy.UpdateCursor(shp, "", "", "some_field")
for row in rows:
    if row.some_field == 2:
        rows.deleteRow(row)
del row
del rows

```

Answer: 
I would begin by creating a copy of the original feature class. Then it is simply a matter of checking if `row[0]` (i.e. Value\_1 field) is equivalent to `row[1]` (Value\_4 field). Try the following approach:

```
import arcpy

in_shp = r"C:\path\to\your\shapefile.shp"
shp_copy = r"C:\path\to\your\shapefile_v2.shp"

# Make a copy!
arcpy.CopyFeatures_management(in_shp, shp_copy)

# Check if "Value_1" is equivalent to "Value_4", if not delete row
with arcpy.da.UpdateCursor(shp_copy, ["Value_1", "Value_4"]) as cursor:
    for row in cursor:
        if row[0] != row[1]:
            cursor.deleteRow()

```
```
import arcpy

fc = r'C:\Users\FILEPATH'
with arcpy.da.UpdateCursor(fc, ["VALUE_1","VALUE_4"]) as cursor:
  for row in cursor:
    if row[0] != row[1]:
      cursor.deleteRow()

```