Why does ArcGIS 10.5 crash when my python script calculates summary statistics

788
5
07-18-2017 04:33 PM
RobertRyan3
New Contributor

The python script calculates drainage areas and land use.  It seems to run fine until the Summary Statistics part when ArcGIS crashes.  I'm running ArcGIS 10.5.  Any ideas what might be causing this?  I've attached the python script

0 Kudos
5 Replies
DanPatterson_Retired
MVP Esteemed Contributor

since the last parameter is optional, did you try to drop it?

    arcpy.Statistics_analysis (tabIntersectSave, sumStatsSave, [["AREA","SUM"]], siteNameColumn)

to arcpy.Statistics_analysis (tabIntersectSave, sumStatsSave, [["AREA","SUM"]])

assuming all the other parameters are correct

and also as a check, your field is called 'AREA' and not SHAPE_Area or something... (this looks like it is the result of a modelbuilder output can you confirm)

RobertRyan3
New Contributor

Dan, thanks for your suggestion. Once I deleted the last parameter as you

suggested, the code ran without causing ArcGIS to crash. However, I then

got an error that the parameter "Sum_Area" in the next line of code did

not exist. However, when I open the sumStats file it is there. Any

thoughts about that?

Robert J. Ryan, Ph.D., P.E.

Associate Professor

Senior Design Coordinator

Civil and Environmental Engineering Department

Temple University

1947 N 12th St

Philadelphia PA 19122

Office: EA515

Phone: 215-204-3054

Fax: 215-204-4696

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

ok modelbuilder outputs should be checked by at least one manual run per step and then examining the contents of the Results window.

When you edit the line above to make it stop crashing... you then have to examine the next line

arcpy.JoinField_management (tabIntersectSave, siteNameColumn, sumStatsSave, siteNameColumn, "SUM_AREA")

and unless you deleted the field, then it would obviously exist.  Always start with a clean version of the input files when testing a model or a script. 

I suggest you isolate that particular step in the workflow and check to see whether the fields do or do not exist in the prior step.

RobertRyan3
New Contributor

Thanks. I will try this and let you know how it works out.

Robert J. Ryan, Ph.D., P.E.

Associate Professor

Senior Design Coordinator

Civil and Environmental Engineering Department

Temple University

1947 N 12th St

Philadelphia PA 19122

Office: EA515

Phone: 215-204-3054

Fax: 215-204-4696

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Robert... resolved?

0 Kudos