I have a String field ('Prefix') and a Double field ('Result'). I am trying to group data by a specific range, <0.002, 0.002 to 0.07, >0.07, however some values have a '<' or '>' prefix contained in the String field. This causes me issues where i have the value 0.07 in one cell and the value 0.07 in another cell with the prefix '<', which represent 0.07 and <0.07 respectively.
What I would like to do is create a new Double attribute called 'Result_Edit'(easy enough) and use Field Calculator to look for all cases where the 'Prefix' field (String) has a '<' or '>' and the 'Result' is 0.002 or 0.07, and either return 0.0019 or 0.071 to the corresponding 'Result' field (Double). The values that have no prefix will remain as they are.
Prefix | Result | Result_Edit
..>.......0.07.......0.071
...........0.07.......0.07
..<.......0.07.......0.07
..<.......0.002......0.0019
...........0.002......0.002
..>.......0.002......0.002
I only care about <0.002 and >0.07.
This is what I have, but it doesn't work.....
def EDIT ( Prefix , Result , Result_Edit ):
if (Prefix = '<' & Result = 0.002):
return 0.0019
elif (Prefix = '>' & Result =0.07):
return 0.071
else:
return Result
EDIT ( !Prefix! , !Result! , !Result_Edit! )
Using ArcGIS Desktop v 10.5 with Python checked.