Select to view content in your preferred language

Update Cursor to place Null Values

465
2
08-30-2022 11:03 AM
AlfredBaldenweck
MVP Regular Contributor

Hi all,

I'd like to use an update cursor to fill in appropriate rows with the data, but I want other rows to be Null. Sometimes a row that was populated should become Null.

How can I get the cursor to input the Null value? I tried 

if (condition):
    row[2]= None
cursor.updateRow(row)

And nothing happened.

Any tips? I'm currently using field calculator to set the entire thing to None, but that's slow, and since I'm using the cursor anyway, I'd like to keep it simple.

0 Kudos
2 Replies
by Anonymous User
Not applicable

what is your full cursor code?

0 Kudos
AlfredBaldenweck
MVP Regular Contributor

Oh.

I was forgetting to refresh to check. 

I think I'm just going to hard code the refresh into the script in the future.

Thanks!

 

0 Kudos