vanjay011379

Statistics_analysis fails

Discussion created by vanjay011379 on Mar 11, 2011
Latest reply on Mar 14, 2011 by clm42
Hello

I am trying to execute Statistics_analysis  from a python script.  However, it fails when I run it.  I exported this from a ModelBuilder from where it runs fine. 

import arcpy

# Local variables:
myShpFile = "C:\\temp\\stats\\forms\\outputDir\\0arbuckle\\intersect_1.shp"
stats_dbf = "C:\\temp\\stats\\waters\\stats.dbf"

# Process: Summary Statistics
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")



However, the execute python script gives me the following error.

Traceback (most recent call last):
  File "stats.py", line 19, in <module>

  File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\analysis.py", line
910, in Statistics
    raise e
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000840: The value is not a String.
ERROR 000840: The value is not a String.
Failed to execute (Statistics).


What is wrong with my script?

Outcomes