Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Else if or maybe Where Clause for Update Cursor.

$
0
0
I have several conditional statements I want to use to update values in an attribute table. I have been using update cursors as of late with some success. But now I am at a point that I am struggling with. I am able to use single argument conditions like

Code:

if row.Bkf_W <= 0:
                row.Width_Cat = 0
                rows.updateRow(row)
            elif row.NEAR_DIST > 100:
                row.Snap_Code = 0
                rows.updateRow(row)

But what if I want to check a range of values. Like : Bkf_W > 0 and Bfw_W <=3 then Width_Cat = 1.
Would it be 0 < Bkf_W <= 3, then Width_Cat = 1? I have several of these "range" conditions (8 total) that I want to use to update cursors. Any help would be appreciated!

Viewing all articles
Browse latest Browse all 2485

Trending Articles