<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SearchCursor row methods missing? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1213316#M65593</link>
    <description>&lt;P&gt;If you want to use field names to refer to row values instead of tuple indexes, you can convert the row to a dict:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.SearchCursor(feature_class, ["list", "of", "field", "names"]) as rows:
    fields = rows.fields
    for row in rows:
        row = dict(zip(fields, row))
        print(row['SOMEFIELD'], row["ANOTHERFIELD"])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 09:00:10 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2022-09-16T09:00:10Z</dc:date>
    <item>
      <title>SearchCursor row methods missing?</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1212434#M65564</link>
      <description>&lt;P&gt;Using arcpy 3.0 - all the row methods described &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/row.htm" target="_self"&gt;here&lt;/A&gt; appear to be missing for a feature layer in a file geodatabase??&lt;/P&gt;&lt;P&gt;For instance the only printed methods for the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.SearchCursor(in_table="Crashes_in_DC",
field_names="Tot_PedBik",) as cursor:
    for row in cursor:
         print(dir(row))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;are&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;'count', 'index'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.SearchCursor(in_table="Crashes_in_DC",
                          field_names="Tot_PedBik",) as cursor:
    for row in cursor:
        print(row.getValue('Tot_PedBik'))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;returns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;AttributeError: 'tuple' object has no attribute 'getValue'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 13:59:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1212434#M65564</guid>
      <dc:creator>mmann1123</dc:creator>
      <dc:date>2022-09-14T13:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor row methods missing?</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1212457#M65566</link>
      <description>&lt;P&gt;How do you open a bug report for this kind of stuff?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 14:55:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1212457#M65566</guid>
      <dc:creator>mmann1123</dc:creator>
      <dc:date>2022-09-14T14:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor row methods missing?</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1212461#M65567</link>
      <description>&lt;P&gt;That documentation is referring to the &lt;A href="https://pro.arcgis.com/en/pro-app/2.9/arcpy/classes/cursor.htm" target="_self"&gt;legacy cursor&lt;/A&gt;, but your code sample is using the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/data-access-using-cursors.htm" target="_self"&gt;new "data access" cursor&lt;/A&gt;. I'm surprised the legacy cursor documentation isn't more clearly identified here. The new "da" cursors returns the row data as a Python tuple (instead of a row object), which only has the &lt;A href="https://www.w3schools.com/python/python_ref_tuple.asp" target="_self"&gt;methods built in for a tuple&lt;/A&gt;. To access data in a particular field, use the index of the field.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.SearchCursor(in_table="Crashes_in_DC",
                          field_names=["Tot_PedBik"]) as cursor:
    for row in cursor:
        print(row[0])&lt;/LI-CODE&gt;&lt;P&gt;Here, it's using index 0 because that's the index of&amp;nbsp;Tot_PedBik in the field_names parameter (which should be a list, even with one field).&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 14:59:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1212461#M65567</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2022-09-14T14:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor row methods missing?</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1212504#M65569</link>
      <description>&lt;P&gt;Ha... Yeah that's totally unclear from the docs but makes sense.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 15:54:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1212504#M65569</guid>
      <dc:creator>mmann1123</dc:creator>
      <dc:date>2022-09-14T15:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor row methods missing?</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1212520#M65570</link>
      <description>&lt;P&gt;There's a feedback option at the bottom of all documentation pages. I already submitted my feedback on this, but you're welcome to submit your feedback too.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 16:12:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1212520#M65570</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2022-09-14T16:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor row methods missing?</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1213316#M65593</link>
      <description>&lt;P&gt;If you want to use field names to refer to row values instead of tuple indexes, you can convert the row to a dict:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.SearchCursor(feature_class, ["list", "of", "field", "names"]) as rows:
    fields = rows.fields
    for row in rows:
        row = dict(zip(fields, row))
        print(row['SOMEFIELD'], row["ANOTHERFIELD"])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:00:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-row-methods-missing/m-p/1213316#M65593</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2022-09-16T09:00:10Z</dc:date>
    </item>
  </channel>
</rss>

