<?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: Any way to sort fields in .da cursors if data isn't FGDB? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/any-way-to-sort-fields-in-da-cursors-if-data-isn-t/m-p/149591#M11591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My work around was to use .da cursors on the Grid vat directly, but load the records into a list, and then sort the list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even though I have to load the entire table into the list with the .da cursor and then sort it in list format (since the .da cursor sort paramter won't work with a Grid vat table), it is still 4x as fast as using the traditional arcpy cursors. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Okay I'm happy - even if the .da cuirsors won't (by themselves) sort a Grid vat.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#make sure the fields are specified in the proper list sort order - luickily I want to sort everything ascending sortRows = [r for r in arcpy.da.SearchCursor(comboGrd, ["PDRND","HAB", "COUNT"])] sortRows.sort() for sortRow in sortRows: &amp;nbsp;&amp;nbsp; blah... &amp;nbsp;&amp;nbsp; blah...&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Oct 2012 17:35:35 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2012-10-10T17:35:35Z</dc:date>
    <item>
      <title>Any way to sort fields in .da cursors if data isn't FGDB?</title>
      <link>https://community.esri.com/t5/python-questions/any-way-to-sort-fields-in-da-cursors-if-data-isn-t/m-p/149590#M11590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;According to the help for the data access cursors, you can only use the SQL sort parameters (ORDER_BY) if the input data is in FGDB format.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a dumb rhetorical question I guess, but: Does this mean we can't use the sort function in the .da cursors if we are using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. in_memory FCs&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Grid attribute tables (.vats)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am craving the speed of the .da cursors, but also the speed of Grid format (as opposed to FGDB raster format) in Spatial Analyst... I guess I will have to go with one or the other &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 23:30:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/any-way-to-sort-fields-in-da-cursors-if-data-isn-t/m-p/149590#M11590</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-10-08T23:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to sort fields in .da cursors if data isn't FGDB?</title>
      <link>https://community.esri.com/t5/python-questions/any-way-to-sort-fields-in-da-cursors-if-data-isn-t/m-p/149591#M11591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My work around was to use .da cursors on the Grid vat directly, but load the records into a list, and then sort the list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even though I have to load the entire table into the list with the .da cursor and then sort it in list format (since the .da cursor sort paramter won't work with a Grid vat table), it is still 4x as fast as using the traditional arcpy cursors. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Okay I'm happy - even if the .da cuirsors won't (by themselves) sort a Grid vat.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#make sure the fields are specified in the proper list sort order - luickily I want to sort everything ascending sortRows = [r for r in arcpy.da.SearchCursor(comboGrd, ["PDRND","HAB", "COUNT"])] sortRows.sort() for sortRow in sortRows: &amp;nbsp;&amp;nbsp; blah... &amp;nbsp;&amp;nbsp; blah...&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 17:35:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/any-way-to-sort-fields-in-da-cursors-if-data-isn-t/m-p/149591#M11591</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-10-10T17:35:35Z</dc:date>
    </item>
  </channel>
</rss>

