Select to view content in your preferred language

Python Code Runs in PyCharm But No Output

11195
10
01-06-2018 10:17 AM
EricWarner
Emerging Contributor

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

0 Kudos
10 Replies
EricWarner
Emerging Contributor

Well it is a work in progress, and it will probably get easier as time goes on.  Tomorrow going to get Spyder up and going.

0 Kudos