How to combine search and update cursor on one table to change values [closed] The 2019 Stack Overflow Developer Survey Results Are In Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar ManaraDebugging ArcPy script to search, get value, compare to field names and sum field values?Creating a value-counting table with search- and update cursorArcPy Update Cursor after nested Search Cursor giving tuple assignment error?Error when updating arcpy.SearchCursor to arcpy.da.SearchCursorArcpy Search Cursor Looping through columns to search for specific valuesUsing dictionary and cursors to calculate a field based on values from another table - KeyError [0]Using two Search and Update cursor pairs on the same feature classCalculating field with ArcPy cursor?Search Cursor Return Field Name If All Rows Contain a ValueSwitching from Nested Search Cursors to Dictionaries

Does Parliament hold absolute power in the UK?

Circular reasoning in L'Hopital's rule

Can we generate random numbers using irrational numbers like π and e?

What do I do when my TA workload is more than expected?

Why can't wing-mounted spoilers be used to steepen approaches?

Why doesn't a hydraulic lever violate conservation of energy?

60's-70's movie: home appliances revolting against the owners

Using dividends to reduce short term capital gains?

Was credit for the black hole image misappropriated?

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

For what reasons would an animal species NOT cross a *horizontal* land bridge?

Can each chord in a progression create its own key?

how can a perfect fourth interval be considered either consonant or dissonant?

should truth entail possible truth

What happens to a Warlock's expended Spell Slots when they gain a Level?

"is" operation returns false with ndarray.data attribute, even though two array objects have same id

Sub-subscripts in strings cause different spacings than subscripts

Keeping a retro style to sci-fi spaceships?

Loose spokes after only a few rides

Store Dynamic-accessible hidden metadata in a cell

Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

Accepted by European university, rejected by all American ones I applied to? Possible reasons?

Presidential Pardon



How to combine search and update cursor on one table to change values [closed]



The 2019 Stack Overflow Developer Survey Results Are In
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraDebugging ArcPy script to search, get value, compare to field names and sum field values?Creating a value-counting table with search- and update cursorArcPy Update Cursor after nested Search Cursor giving tuple assignment error?Error when updating arcpy.SearchCursor to arcpy.da.SearchCursorArcpy Search Cursor Looping through columns to search for specific valuesUsing dictionary and cursors to calculate a field based on values from another table - KeyError [0]Using two Search and Update cursor pairs on the same feature classCalculating field with ArcPy cursor?Search Cursor Return Field Name If All Rows Contain a ValueSwitching from Nested Search Cursors to Dictionaries



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm working a script for drives, I would like to read the values from the "Layer" field, if the values state "D-DRIVE-PAVE-P" then I want the field "SURFACEM" to be ANG if not then GR.



import arcpy, os

cursor = arcpy.da.SearchCursor(MyTable, ["D-DRIVE-PAVE-P"])
for row in cursor:
D-DRIVE-PAVE-P.add(row[0]

cursor = arcpy.da.UpdateCursor(MyTable, ["Layer", "SURFACEM"])
for row in cursor:
if row[0] in D-DRIVE-PAVE-P:
row[1] = "ANG"
else:
row[1] = "GR"
cursor.updateRow(row)
del cursor


This is what I have however I am receiving a syntax error with this line of coding.










share|improve this question









New contributor




T. Tobin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











closed as unclear what you're asking by PolyGeo Apr 7 at 7:18


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 3





    Add the error message to your question. You are missing as cursor: at the searchcursor and the indentation after is incorrect. What is this supposed to do: D-DRIVE-PAVE-P.add(row[0]

    – BERA
    Apr 7 at 6:34












  • When you provide code, please make sure that it is the smallest code to exhibit the problem. You have dedicated ten-plus lines of the question to compiling a list which isn't used in the cursor blocks, and the cursor blocks themselves contain many syntax errors that prevent script execution (with usage, indentation, variable naming, open parenthesis), which really ought to be resolved before the question is asked.

    – Vince
    Apr 7 at 12:58






  • 2





    your search cursor is misused. Update cursor is enough in your case, either with your test or by first making a layer (makefeaturelayer) that only include the row matching a quesry

    – radouxju
    Apr 8 at 16:40

















0















I'm working a script for drives, I would like to read the values from the "Layer" field, if the values state "D-DRIVE-PAVE-P" then I want the field "SURFACEM" to be ANG if not then GR.



import arcpy, os

cursor = arcpy.da.SearchCursor(MyTable, ["D-DRIVE-PAVE-P"])
for row in cursor:
D-DRIVE-PAVE-P.add(row[0]

cursor = arcpy.da.UpdateCursor(MyTable, ["Layer", "SURFACEM"])
for row in cursor:
if row[0] in D-DRIVE-PAVE-P:
row[1] = "ANG"
else:
row[1] = "GR"
cursor.updateRow(row)
del cursor


This is what I have however I am receiving a syntax error with this line of coding.










share|improve this question









New contributor




T. Tobin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











closed as unclear what you're asking by PolyGeo Apr 7 at 7:18


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 3





    Add the error message to your question. You are missing as cursor: at the searchcursor and the indentation after is incorrect. What is this supposed to do: D-DRIVE-PAVE-P.add(row[0]

    – BERA
    Apr 7 at 6:34












  • When you provide code, please make sure that it is the smallest code to exhibit the problem. You have dedicated ten-plus lines of the question to compiling a list which isn't used in the cursor blocks, and the cursor blocks themselves contain many syntax errors that prevent script execution (with usage, indentation, variable naming, open parenthesis), which really ought to be resolved before the question is asked.

    – Vince
    Apr 7 at 12:58






  • 2





    your search cursor is misused. Update cursor is enough in your case, either with your test or by first making a layer (makefeaturelayer) that only include the row matching a quesry

    – radouxju
    Apr 8 at 16:40













0












0








0








I'm working a script for drives, I would like to read the values from the "Layer" field, if the values state "D-DRIVE-PAVE-P" then I want the field "SURFACEM" to be ANG if not then GR.



import arcpy, os

cursor = arcpy.da.SearchCursor(MyTable, ["D-DRIVE-PAVE-P"])
for row in cursor:
D-DRIVE-PAVE-P.add(row[0]

cursor = arcpy.da.UpdateCursor(MyTable, ["Layer", "SURFACEM"])
for row in cursor:
if row[0] in D-DRIVE-PAVE-P:
row[1] = "ANG"
else:
row[1] = "GR"
cursor.updateRow(row)
del cursor


This is what I have however I am receiving a syntax error with this line of coding.










share|improve this question









New contributor




T. Tobin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm working a script for drives, I would like to read the values from the "Layer" field, if the values state "D-DRIVE-PAVE-P" then I want the field "SURFACEM" to be ANG if not then GR.



import arcpy, os

cursor = arcpy.da.SearchCursor(MyTable, ["D-DRIVE-PAVE-P"])
for row in cursor:
D-DRIVE-PAVE-P.add(row[0]

cursor = arcpy.da.UpdateCursor(MyTable, ["Layer", "SURFACEM"])
for row in cursor:
if row[0] in D-DRIVE-PAVE-P:
row[1] = "ANG"
else:
row[1] = "GR"
cursor.updateRow(row)
del cursor


This is what I have however I am receiving a syntax error with this line of coding.







arcpy






share|improve this question









New contributor




T. Tobin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




T. Tobin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Apr 8 at 16:54







T. Tobin













New contributor




T. Tobin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 7 at 5:19









T. TobinT. Tobin

11




11




New contributor




T. Tobin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





T. Tobin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






T. Tobin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




closed as unclear what you're asking by PolyGeo Apr 7 at 7:18


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as unclear what you're asking by PolyGeo Apr 7 at 7:18


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 3





    Add the error message to your question. You are missing as cursor: at the searchcursor and the indentation after is incorrect. What is this supposed to do: D-DRIVE-PAVE-P.add(row[0]

    – BERA
    Apr 7 at 6:34












  • When you provide code, please make sure that it is the smallest code to exhibit the problem. You have dedicated ten-plus lines of the question to compiling a list which isn't used in the cursor blocks, and the cursor blocks themselves contain many syntax errors that prevent script execution (with usage, indentation, variable naming, open parenthesis), which really ought to be resolved before the question is asked.

    – Vince
    Apr 7 at 12:58






  • 2





    your search cursor is misused. Update cursor is enough in your case, either with your test or by first making a layer (makefeaturelayer) that only include the row matching a quesry

    – radouxju
    Apr 8 at 16:40












  • 3





    Add the error message to your question. You are missing as cursor: at the searchcursor and the indentation after is incorrect. What is this supposed to do: D-DRIVE-PAVE-P.add(row[0]

    – BERA
    Apr 7 at 6:34












  • When you provide code, please make sure that it is the smallest code to exhibit the problem. You have dedicated ten-plus lines of the question to compiling a list which isn't used in the cursor blocks, and the cursor blocks themselves contain many syntax errors that prevent script execution (with usage, indentation, variable naming, open parenthesis), which really ought to be resolved before the question is asked.

    – Vince
    Apr 7 at 12:58






  • 2





    your search cursor is misused. Update cursor is enough in your case, either with your test or by first making a layer (makefeaturelayer) that only include the row matching a quesry

    – radouxju
    Apr 8 at 16:40







3




3





Add the error message to your question. You are missing as cursor: at the searchcursor and the indentation after is incorrect. What is this supposed to do: D-DRIVE-PAVE-P.add(row[0]

– BERA
Apr 7 at 6:34






Add the error message to your question. You are missing as cursor: at the searchcursor and the indentation after is incorrect. What is this supposed to do: D-DRIVE-PAVE-P.add(row[0]

– BERA
Apr 7 at 6:34














When you provide code, please make sure that it is the smallest code to exhibit the problem. You have dedicated ten-plus lines of the question to compiling a list which isn't used in the cursor blocks, and the cursor blocks themselves contain many syntax errors that prevent script execution (with usage, indentation, variable naming, open parenthesis), which really ought to be resolved before the question is asked.

– Vince
Apr 7 at 12:58





When you provide code, please make sure that it is the smallest code to exhibit the problem. You have dedicated ten-plus lines of the question to compiling a list which isn't used in the cursor blocks, and the cursor blocks themselves contain many syntax errors that prevent script execution (with usage, indentation, variable naming, open parenthesis), which really ought to be resolved before the question is asked.

– Vince
Apr 7 at 12:58




2




2





your search cursor is misused. Update cursor is enough in your case, either with your test or by first making a layer (makefeaturelayer) that only include the row matching a quesry

– radouxju
Apr 8 at 16:40





your search cursor is misused. Update cursor is enough in your case, either with your test or by first making a layer (makefeaturelayer) that only include the row matching a quesry

– radouxju
Apr 8 at 16:40










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Crop image to path created in TikZ? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Crop an inserted image?TikZ pictures does not appear in posterImage behind and beyond crop marks?Tikz picture as large as possible on A4 PageTransparency vs image compression dilemmaHow to crop background from image automatically?Image does not cropTikzexternal capturing crop marks when externalizing pgfplots?How to include image path that contains a dollar signCrop image with left size given

រឿង រ៉ូមេអូ និង ហ្ស៊ុយលីយេ សង្ខេបរឿង តួអង្គ បញ្ជីណែនាំ

Ромео және Джульетта Мазмұны Қысқаша сипаттамасы Кейіпкерлері Кино Дереккөздер Бағыттау мәзірі