<?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: Converting Pandas Dataframe to GIS Table in_memory Fails with arcgis.features.GeoAccessor.spatial.to_table() in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1587709#M73771</link>
    <description>&lt;P&gt;Just came across this issue today. Here is the code I used to get it working. I'm on Pro 3.2.3&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import pandas as pd
from arcgis.features import GeoAccessor, GeoSeriesAccessor
import arcpy

LeaseOut = pd.read_csv(filepath_or_buffer=f"Z:\\Work\\xyzx")
#do pandas manipulation
LeaseOut_sp =LeaseOut.spatial.to_table('in_memory/processed_table')
LeaseOutCSV = arcpy.CopyRows_management(LeaseOut_sp, 'LeaseOutCSV') &lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 20 Feb 2025 21:38:26 GMT</pubDate>
    <dc:creator>DrewDowling</dc:creator>
    <dc:date>2025-02-20T21:38:26Z</dc:date>
    <item>
      <title>Converting Pandas Dataframe to GIS Table in_memory Fails with arcgis.features.GeoAccessor.spatial.to_table()</title>
      <link>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1054322#M61021</link>
      <description>&lt;P&gt;Hi, I am using the GeoAccessor module inside arcgis.features to enable spatial features in pandas dataframes to process some data as part of a python toolbox tool. I was able to convert a database table to a pandas dataframe and perform all the necessary data manipulation, but when I try to bring it back into a GIS table in_memory it doesn't seem to work.&lt;/P&gt;&lt;PRE&gt;# Convert my pandas dataframe 'sdf_table' to a GIS database table in_memory&lt;BR /&gt;processed_table = sdf_table.spatial.to_table(&lt;SPAN&gt;'in_memory/processed_table'&lt;/SPAN&gt;)&lt;BR /&gt;...&lt;BR /&gt;# After additional processing, copy this table to the user specified output database table&lt;BR /&gt;&lt;SPAN&gt;output_table &lt;/SPAN&gt;= arcpy.CopyFeatures_management(processed_table&lt;SPAN&gt;, &lt;/SPAN&gt;output_table)&lt;/PRE&gt;&lt;P&gt;This code fails on the Copy Features function, saying that the in_memory table does not exist or is not supported. It DOES work if I skip the in_memory output and just output directly to the final database location in the to_table() method. This leads me to believe that the arcgis.features.GeoAccessor.spatial.to_table() method does not support in_memory output, but I can't find any documentation saying that. Can anyone confirm this? I find it strange that there are no errors or warnings if the output path is not supported.&lt;/P&gt;&lt;PRE&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 3886, in CopyFeatures&lt;BR /&gt;retval = convertArcObjectToPythonObject(gp.CopyFeatures_management(*gp_fixargs((in_features, out_feature_class, config_keyword, spatial_grid_1, spatial_grid_2, spatial_grid_3), True)))&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 511, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;&lt;STRONG&gt;ERROR 000732: Input Features: Dataset in_memory\processed_table does not exist or is not supported&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 17:54:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1054322#M61021</guid>
      <dc:creator>Justin_P</dc:creator>
      <dc:date>2021-05-04T17:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Pandas Dataframe to GIS Table in_memory Fails with arcgis.features.GeoAccessor.spatial.to_table()</title>
      <link>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1054351#M61022</link>
      <description>&lt;P&gt;how about&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;r'memory\processed_table'&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 May 2021 18:29:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1054351#M61022</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-05-04T18:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Pandas Dataframe to GIS Table in_memory Fails with arcgis.features.GeoAccessor.spatial.to_table()</title>
      <link>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1054367#M61023</link>
      <description>&lt;P&gt;I did have a little bit of hope with this, but unfortunately it appears that it doesn't like the 'memory' workspace either and fails with the same error when I try to access it with the next function.&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 18:54:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1054367#M61023</guid>
      <dc:creator>Justin_P</dc:creator>
      <dc:date>2021-05-04T18:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Pandas Dataframe to GIS Table in_memory Fails with arcgis.features.GeoAccessor.spatial.to_table()</title>
      <link>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1054762#M61038</link>
      <description>&lt;P&gt;Just for the record, this was a silly mistake that had nothing to do with in_memory. I was using Copy Features when I should have been using Copy Rows since the output is strictly tabular.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 17:10:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1054762#M61038</guid>
      <dc:creator>Justin_P</dc:creator>
      <dc:date>2021-05-05T17:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Pandas Dataframe to GIS Table in_memory Fails with arcgis.features.GeoAccessor.spatial.to_table()</title>
      <link>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1333038#M68764</link>
      <description>&lt;P&gt;For those who are still having problems with this method, it's filed as a BUG "In Review":&lt;BR /&gt;&lt;A href="https://support.esri.com/en-us/bug/there-is-a-bug-in-the-spatial-dataframe-option-totable-bug-000154755" target="_self"&gt;https://support.esri.com/en-us/bug/there-is-a-bug-in-the-spatial-dataframe-option-totable-bug-000154755&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 18:37:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1333038#M68764</guid>
      <dc:creator>alex_friant</dc:creator>
      <dc:date>2023-09-27T18:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Pandas Dataframe to GIS Table in_memory Fails with arcgis.features.GeoAccessor.spatial.to_table()</title>
      <link>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1587709#M73771</link>
      <description>&lt;P&gt;Just came across this issue today. Here is the code I used to get it working. I'm on Pro 3.2.3&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import pandas as pd
from arcgis.features import GeoAccessor, GeoSeriesAccessor
import arcpy

LeaseOut = pd.read_csv(filepath_or_buffer=f"Z:\\Work\\xyzx")
#do pandas manipulation
LeaseOut_sp =LeaseOut.spatial.to_table('in_memory/processed_table')
LeaseOutCSV = arcpy.CopyRows_management(LeaseOut_sp, 'LeaseOutCSV') &lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 20 Feb 2025 21:38:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/converting-pandas-dataframe-to-gis-table-in-memory/m-p/1587709#M73771</guid>
      <dc:creator>DrewDowling</dc:creator>
      <dc:date>2025-02-20T21:38:26Z</dc:date>
    </item>
  </channel>
</rss>

