<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can't open spatial dataframe in Spyder 4.2.1 Variable Explorer - not picklable in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031064#M5617</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;. Using ArcGIS Pro 2.7.1, cloned Python environment from ArcGIS default to which I've added Spyder.&lt;/P&gt;&lt;P&gt;Default Spyder install via this method is Spyder 3.6. This runs but does nothing when I try to view the spatial dataframe in Variable Explorer. Upgrading Spyder to 4.2.1 also runs, but gives error message the pickling error message in original post. Using the upgrade arcgis method you posted tells me that it's already installed. This is really baffling me. Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 17:58:36 GMT</pubDate>
    <dc:creator>Zeke</dc:creator>
    <dc:date>2021-02-26T17:58:36Z</dc:date>
    <item>
      <title>Can't open spatial dataframe in Spyder 4.2.1 Variable Explorer - not picklable</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1030210#M5615</link>
      <description>&lt;P&gt;I upgraded to Spyder 4.2.1 from 3.6, and now when I run my script that creates a spatially enabled dataframe, the dataframe 'sdf' won't open in Variable Explorer. Instead it gives a message stating 'The variable is not picklable'. The console pane shows a long traceback ending in '&lt;BR /&gt;_pickle.PicklingError: Can't pickle 'geoprocessing server result object' object: &amp;lt;geoprocessing server result object object at 0x000001F686A82A80&amp;gt;'.&lt;/P&gt;&lt;P&gt;This was working before the upgrade, and I'm thinking after it for a while as well (might be wrong there). running things like sdf.head() works fine. Code below.&lt;/P&gt;&lt;P&gt;Running Python 3.7.9 64-bit | Qt 5.9.6 | PyQt 5.9.2 | Windows 10 | Spyder 4.2.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import time as t
import os
import sys
import pandas as pd
import arcpy
from arcpy import env
from arcgis.features import GeoAccessor, GeoSeriesAccessor

gdb = r"C:\Users\Owner\Desktop\Tract_Aggregation\Tract_aggregation.gdb"
fds = 'Detroit_tracts'
# fc = 'All_Detroit_Tracts_TL_Data_lt_4200'
fc = 'Tract_Agg_1_021621_New'
census_tracts = os.path.join(gdb, fds, fc)
mem_tracts = arcpy.management.MakeFeatureLayer(census_tracts, r"memory\tracts")
env.overwriteOutput = True
env.workspace = os.path.join(gdb, fds)
cutoff = 4200
used_gids = []


def create_sdf():
    """
    Returns
    -------
    df : Pandas Dataframe
        Census tracts.
    """
    print('\tCreating Spatial DataFrame...')
    drop_flds = ['OBJECTID',
                 'objectid_1',
                 'object_id']
    try:
        df = pd.DataFrame.spatial.from_featureclass(mem_tracts)
        df.dropna(subset=['geoid'], inplace=True)
        df.drop(drop_flds, axis=1, inplace=True)
        df['under125pe'] = df['under125pe'] * 1.0
        df['under200pe'] = df['under200pe'] * 1.0
        df['under125pe'].fillna(0.0)
        df['under200pe'].fillna(0.0)
        df.set_index('geoid', inplace=True, drop=False)
        df.rename_axis('gid', inplace=True)
        df.sort_values(by='total_hh', axis=0,
                       ascending=False, inplace=True)
        print('\tSpatial DataFrame created\n')
        return df
    except Exception as e:
        print(sys.exc_value)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 21:26:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1030210#M5615</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2021-02-24T21:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can't open spatial dataframe in Spyder 4.2.1 Variable Explorer - not picklable</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1030259#M5616</link>
      <description>&lt;P&gt;What version of arcgis?&lt;/P&gt;&lt;P&gt;There were recent issues with pandas dataframes&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-python-api/issues/874" target="_blank" rel="noopener"&gt;Spatially Enabled Data Frame not working with pandas datetime · Issue #874 · Esri/arcgis-python-api (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;conda upgrade --no-pin arcgis&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this was the solution&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not a spyder issue that I could find on their Issues link&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/spyder-ide/spyder/issues" target="_blank"&gt;Issues · spyder-ide/spyder (github.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 22:39:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1030259#M5616</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-02-24T22:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can't open spatial dataframe in Spyder 4.2.1 Variable Explorer - not picklable</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031064#M5617</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;. Using ArcGIS Pro 2.7.1, cloned Python environment from ArcGIS default to which I've added Spyder.&lt;/P&gt;&lt;P&gt;Default Spyder install via this method is Spyder 3.6. This runs but does nothing when I try to view the spatial dataframe in Variable Explorer. Upgrading Spyder to 4.2.1 also runs, but gives error message the pickling error message in original post. Using the upgrade arcgis method you posted tells me that it's already installed. This is really baffling me. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 17:58:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031064#M5617</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2021-02-26T17:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can't open spatial dataframe in Spyder 4.2.1 Variable Explorer - not picklable</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031080#M5618</link>
      <description>&lt;P&gt;I suspect you won't be able to since it isn't a true Pandas df.&amp;nbsp; I doubt the spyder crew will have much interest in providing support unless there is a widespread need.&amp;nbsp; Numpy and Pandas work fine&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 18:47:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031080#M5618</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-02-26T18:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can't open spatial dataframe in Spyder 4.2.1 Variable Explorer - not picklable</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031342#M5620</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;. Maybe so, but prior to a few days ago it would display it. Oh well.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 18:03:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031342#M5620</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2021-02-28T18:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can't open spatial dataframe in Spyder 4.2.1 Variable Explorer - not picklable</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031350#M5621</link>
      <description>&lt;P&gt;was the arcgis module updated during the process?&amp;nbsp; Lots of Issues on their github site with the transition from 1.8.2 to 1.8.3 to 1.8.4&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 18:34:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031350#M5621</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-02-28T18:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can't open spatial dataframe in Spyder 4.2.1 Variable Explorer - not picklable</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031378#M5622</link>
      <description>&lt;P&gt;That may be it. I did get the latest (afaik) arcgis module.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 22:27:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-open-spatial-dataframe-in-spyder-4-2-1/m-p/1031378#M5622</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2021-02-28T22:27:54Z</dc:date>
    </item>
  </channel>
</rss>

