I have a line shapefile that used for some calculation. One of the calculation is subtracting values with a same group ID. The shapefile has a filed called LineID that consists of 2 lines with Side 1 and side 2. Value of A_path1 from side 1 should subtracted from Side 2 that have same LineID and stored in field called Diff in front of sid 1 or side 2 (doesn’t matter each).

How do I write a script with it with ArcPy in Python?

enter image description here

closed as off-topic by Vince, BERA, LaughU, PolyGeo Apr 29 at 12:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – Vince, BERA, LaughU, PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    What have you tried? What error did you receive? – Vince Apr 29 at 11:18
  • @vice I have tried any. I am not professional in python and arcpy. – Anahita Kp Apr 29 at 11:41
  • You don't need to be a Field Calculator professional in order to make an attempt at code. Refusing to make an attempt to follow examples and make a best effort may convey an attitude that you either don't care or think the task beneath you, neither of which is going to help get the task completed. – Vince Apr 29 at 13:12

alternatively without scripting :

multiply side 2 value by -1 (field calculator)

summarize table asking the sum of you field, based on the LineID field

join the resulting table to you original table
  • thanks but I prefer to have it as a script. – Anahita Kp Apr 29 at 12:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.