1851
2
02-20-2018 11:52 AM
New Contributor

 Grouping Analysis—ArcGIS Pro | ArcGIS Desktoppro.arcgis.comLegacy: The algorithm behind the Grouping Analysis tool has been enhanced and new functionality has been added to these methods at ArcGIS Pro 2.1.

arcpy.stats.GroupingAnalysis("Serious Violent Crimes", "CCN", r"D:\Kathy\Desktop\ProT\EsriPress\bookdata\GIST1Pro\Chapter9\Tutorials\Chapter9.gdb\SeriousViolentCrimes_Groupin", 5, "Hierarchy;ArrGender;ArrRace;ARRAgeStnd", "NO_SPATIAL_CONSTRAINT", "EUCLIDEAN", None, None, "GET_SEEDS_FROM_FIELD", "Seed", r"D:\Kathy\Desktop\ProT\EsriPress\bookdata\GIST1Pro\Chapter9\Tutorials\clustereport.pdf", "DO_NOT_EVALUATE")
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'arcpy' is not defined
import arcpy
arcpy.stats.GroupingAnalysis("Serious Violent Crimes", "CCN", r"D:\Kathy\Desktop\ProT\EsriPress\bookdata\GIST1Pro\Chapter9\Tutorials\Chapter9.gdb\SeriousViolentCrimes_Groupin", 5, "Hierarchy;ArrGender;ArrRace;ARRAgeStnd", "NO_SPATIAL_CONSTRAINT", "EUCLIDEAN", None, None, "GET_SEEDS_FROM_FIELD", "Seed", r"D:\Kathy\Desktop\ProT\EsriPress\bookdata\GIST1Pro\Chapter9\Tutorials\clustereport.pdf", "DO_NOT_EVALUATE")
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "d:\arcgis\pro\Resources\arcpy\arcpy\stats.py", line 772, in GroupingAnalysis
raise e
File "d:\arcgis\pro\Resources\arcpy\arcpy\stats.py", line 769, in GroupingAnalysis
retval = convertArcObjectToPythonObject(gp.GroupingAnalysis_stats(*gp_fixargs((Input_Features, Unique_ID_Field, Output_Feature_Class, Number_of_Groups, Analysis_Fields, Spatial_Constraints, Distance_Method, Number_of_Neighbors, Weights_Matrix_File, Initialization_Method, Initialization_Field, Output_Report_File, Evaluate_Optimal_Number_of_Groups), True)))
File "d:\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 506, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: Traceback (most recent call last):
File "d:\arcgis\pro\Resources\ArcToolbox\Scripts\Partition.py", line 30, in <module>
import SSUtilities as UTILS
File "d:\arcgis\pro\Resources\ArcToolbox\Scripts\SSUtilities.py", line 25, in <module>
import SSDataObject as SSDO
File "d:\arcgis\pro\Resources\ArcToolbox\Scripts\SSDataObject.py", line 27, in <module>
import WeightsUtilities as WU
File "d:\arcgis\pro\Resources\ArcToolbox\Scripts\WeightsUtilities.py", line 22, in <module>
import SSPanelObject as SSPO
File "d:\arcgis\pro\Resources\ArcToolbox\Scripts\SSPanelObject.py", line 18, in <module>
import pandas as PANDAS
File "D:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\__init__.py", line 42, in <module>
from pandas.core.api import *
File "D:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\api.py", line 10, in <module>
from pandas.core.groupby import Grouper
File "D:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\groupby.py", line 49, in <module>
from pandas.core.frame import DataFrame
File "D:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\frame.py", line 67, in <module>
from pandas.core.generic import NDFrame, _shared_docs
File "D:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\generic.py", line 41, in <module>
import pandas.core.indexing as indexing
AttributeError: module 'pandas' has no attribute 'core'
Failed to execute (GroupingAnalysis).
import arcpy
GroupingAnalysis_stats("Serious Violent Crimes", "CCN", r"D:\Kathy\Desktop\ProT\EsriPress\bookdata\GIST1Pro\Chapter9\Tutorials\Chapter9.gdb\SeriousViolentCrimes_Groupin", 5, "Hierarchy;ArrGender;ArrRace;ARRAgeStnd", "NO_SPATIAL_CONSTRAINT", "EUCLIDEAN", None, None, "GET_SEEDS_FROM_FIELD", "Seed", r"D:\Kathy\Desktop\ProT\EsriPress\bookdata\GIST1Pro\Chapter9\Tutorials\clustereport.pdf", "DO_NOT_EVALUATE")
Traceback (most recent call last):
File "<string>", line 2, in <module>
NameError: name 'GroupingAnalysis_stats' is not defined
import arcpy
arcpy.stats.GroupingAnalysis("Serious Violent Crimes", "CCN", r"D:\Kathy\Desktop\ProT\EsriPress\bookdata\GIST1Pro\Chapter9\Tutorials\Chapter9.gdb\SeriousViolentCrimes_Groupin", 5, "Hierarchy;ArrGender;ArrRace;ARRAgeStnd", "NO_SPATIAL_CONSTRAINT", "EUCLIDEAN", None, None, "GET_SEEDS_FROM_FIELD", "Seed", r"D:\Kathy\Desktop\ProT\EsriPress\bookdata\GIST1Pro\Chapter9\Tutorials\clustereport.pdf", "DO_NOT_EVALUATE")
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "d:\arcgis\pro\Resources\arcpy\arcpy\stats.py", line 772, in GroupingAnalysis
raise e
File "d:\arcgis\pro\Resources\arcpy\arcpy\stats.py", line 769, in GroupingAnalysis
retval = convertArcObjectToPythonObject(gp.GroupingAnalysis_stats(*gp_fixargs((Input_Features, Unique_ID_Field, Output_Feature_Class, Number_of_Groups, Analysis_Fields, Spatial_Constraints, Distance_Method, Number_of_Neighbors, Weights_Matrix_File, Initialization_Method, Initialization_Field, Output_Report_File, Evaluate_Optimal_Number_of_Groups), True)))
File "d:\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 506, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: Traceback (most recent call last):
File "d:\arcgis\pro\Resources\ArcToolbox\Scripts\Partition.py", line 30, in <module>
import SSUtilities as UTILS
File "d:\arcgis\pro\Resources\ArcToolbox\Scripts\SSUtilities.py", line 25, in <module>
import SSDataObject as SSDO
File "d:\arcgis\pro\Resources\ArcToolbox\Scripts\SSDataObject.py", line 27, in <module>
import WeightsUtilities as WU
File "d:\arcgis\pro\Resources\ArcToolbox\Scripts\WeightsUtilities.py", line 22, in <module>
import SSPanelObject as SSPO
File "d:\arcgis\pro\Resources\ArcToolbox\Scripts\SSPanelObject.py", line 18, in <module>
import pandas as PANDAS
File "D:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\__init__.py", line 42, in <module>
from pandas.core.api import *
File "D:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\api.py", line 10, in <module>
from pandas.core.groupby import Grouper
File "D:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\groupby.py", line 49, in <module>
from pandas.core.frame import DataFrame
File "D:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\frame.py", line 67, in <module>
from pandas.core.generic import NDFrame, _shared_docs
File "D:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\generic.py", line 41, in <module>
import pandas.core.indexing as indexing
AttributeError: module 'pandas' has no attribute 'core'
Failed to execute (GroupingAnalysis).
2 Replies
Occasional Contributor II

Kory Kramer‌ I'm also getting this pandas error trying to run the TableToExcel_conversion tool from the Python window, but I think this would be classified more appropriately under ArcGIS Pro or Analysis

Community Moderator