<?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: Statistics_analysis fails in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147974#M11488</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To use this I apparently have to create a front end interface.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I copy as Python snippet it only gives me the python interface call like arcpy.("", "").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It does not give me the python statistical invocation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Mar 2011 12:24:08 GMT</pubDate>
    <dc:creator>ChristopherJursa</dc:creator>
    <dc:date>2011-03-14T12:24:08Z</dc:date>
    <item>
      <title>Statistics_analysis fails</title>
      <link>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147970#M11484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to execute Statistics_analysis&amp;nbsp; from a python script.&amp;nbsp; However, it fails when I run it.&amp;nbsp; I exported this from a ModelBuilder from where it runs fine.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;import arcpy&lt;BR /&gt;&lt;BR /&gt;# Local variables:&lt;BR /&gt;myShpFile = "C:\\temp\\stats\\forms\\outputDir\\0arbuckle\\intersect_1.shp"&lt;BR /&gt;stats_dbf = "C:\\temp\\stats\\waters\\stats.dbf"&lt;BR /&gt;&lt;BR /&gt;# Process: Summary Statistics&lt;BR /&gt;arcpy.Statistics_analysis(myShpFile, stats_dbf, "field1 MIN;field1 MEAN;field1 MAX;field1 RANGE;field1 STD;field2 MIN;field2 MEAN;field2 MAX;field2 STD;field2 RANGE")&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the execute python script gives me the following error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "stats.py", line 19, in &amp;lt;module&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\analysis.py", line&lt;BR /&gt; 910, in Statistics&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;BR /&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 000840: The value is not a String.&lt;BR /&gt;ERROR 000840: The value is not a String.&lt;BR /&gt;Failed to execute (Statistics).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is wrong with my script?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 12:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147970#M11484</guid>
      <dc:creator>ChristopherJursa</dc:creator>
      <dc:date>2011-03-11T12:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics_analysis fails</title>
      <link>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147971#M11485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try running the tool outside of a model or script. Go to the results window and right click on the results and select "copy as python snippit." Paste this into IDLE or whatever and compare. Exports from model builder sometimes wonk out like this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 16:37:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147971#M11485</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2011-03-11T16:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics_analysis fails</title>
      <link>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147972#M11486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Try running the tool outside of a model or script. Go to the results window and right click on the results and select "copy as python snippit." Paste this into IDLE or whatever and compare. Exports from model builder sometimes wonk out like this.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What results window are you referring?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 17:03:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147972#M11486</guid>
      <dc:creator>ChristopherJursa</dc:creator>
      <dc:date>2011-03-11T17:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics_analysis fails</title>
      <link>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147973#M11487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In Map or Catalog, on the geoprocessing menu there is a results option. Clicking it will open up a new pane that has previously run tools in it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 18:34:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147973#M11487</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2011-03-11T18:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics_analysis fails</title>
      <link>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147974#M11488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To use this I apparently have to create a front end interface.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I copy as Python snippet it only gives me the python interface call like arcpy.("", "").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It does not give me the python statistical invocation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 12:24:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147974#M11488</guid>
      <dc:creator>ChristopherJursa</dc:creator>
      <dc:date>2011-03-14T12:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics_analysis fails</title>
      <link>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147975#M11489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I dont know why it isnt giving you the syntax when you do the snippit copy thing. Thats how many of us get complex syntax without having to type it all out by hand. I think one thing may be the way that model builder formatted your tool. It may have given you the syntax for 9.3.x instead of 10.x. Now the fields and stat type are strings in nested lists.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Statistics_analysis(myShpFile, stats_dbf, [["field1","MIN"],["field1","MEAN"],["field1","MAX"],["field1","RANGE"],["field1","STD"],["field2","MIN"],["field2","MEAN"],["field2","MAX"],["field2","STD"],["field2","RANGE"]])&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 12:58:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147975#M11489</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2011-03-14T12:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics_analysis fails</title>
      <link>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147976#M11490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I dont know why it isnt giving you the syntax when you do the snippit copy thing. Thats how many of us get complex syntax without having to type it all out by hand. I think one thing may be the way that model builder formatted your tool. It may have given you the syntax for 9.3.x instead of 10.x. Now the fields and stat type are strings in nested lists.&lt;BR /&gt;Try:&lt;BR /&gt;arcpy.Statistics_analysis(myShpFile, stats_dbf, [["field1","MIN"],["field1","MEAN"],["field1","MAX"],["field1","RANGE"],["field1","STD"],["field2","MIN"],["field2","MEAN"],["field2","MAX"],["field2","STD"],["field2","RANGE"]])&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You must have posted this right when I got the answer myself.&amp;nbsp; The help system had this syntax and it worked.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To do the code snippet procedure you mentioned, do I need to have an interaface on the tool or could I just build a mode without an interface?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 13:00:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147976#M11490</guid>
      <dc:creator>ChristopherJursa</dc:creator>
      <dc:date>2011-03-14T13:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics_analysis fails</title>
      <link>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147977#M11491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The code snippit would be for the stat tool specifically. Run Summary Statistics only and then copy its syntax.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 13:18:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/statistics-analysis-fails/m-p/147977#M11491</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2011-03-14T13:18:38Z</dc:date>
    </item>
  </channel>
</rss>

