AnsweredAssumed Answered

Python Code Runs in PyCharm But No Output

Question asked by edw on Jan 6, 2018
Latest reply on Jan 7, 2018 by edw

Hi,

    Learning ArcGIS Pro (2.0), as well as the new API.  I have been able to get Jupyter Notebooks going and run the sample code from index | ArcGIS for Developers  .  I wanted to use PyCharm as an alternative IDE to Jupyter and I have it also running.  I was able to run this section of code (from the NYC Cab demonstration notebook ) in PyCharm successfully, as indicated that it can back with a code of 0 .

 

import arcgis
from arcgis.gis import GIS

ago_gis = GIS() # Connect to ArcGIS Online as an anonymous user
search_subset = ago_gis.content.search("NYC_taxi_subset", item_type = "Feature Layer")
subset_item = search_subset[0]
subset_item

subset_map = ago_gis.map("New York, NY", zoomlevel=11)
subset_map


subset_map.add_layer(subset_item)

subset_feature_layer = subset_item.layers[0]

# query the attribute information. Limit to first 5 rows.
query_result = subset_feature_layer.query(where = 'OBJECTID < 5',
                                          out_fields = "*",
                                          returnGeometry = False)

att_data_frame = query_result.df # get as a Pandas dataframe
att_data_frame

However none of the maps were displayed nor the table, which gets loaded into the dataframe.  I have tried this code in a new Jupyter Notebook and the maps don't get displayed but the table does.  I'm wondering why the differences between the three IDE locations, in terms of the varying output.

 

Thanks,

Eric

Outcomes