<?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: Output Spatial Dataframe/Dataframe to Table on ArcGIS Online in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1214801#M7789</link>
    <description>&lt;P&gt;If I set the arguments to my AGOL org account i.e.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis = GIS(url, username, password)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and use to_table method::&lt;/P&gt;&lt;LI-CODE lang="python"&gt;projectIdeasTable = sdf.spatial.to_table(name='ProjectIdeas.csv', location=gis)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this string error:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [73], in &amp;lt;cell line: 1&amp;gt;()
----&amp;gt; 1 projectIdeasTable = sdf.spatial.to_table(name='ProjectIdeas.csv', location=gis)

File /opt/conda/lib/python3.9/site-packages/arcgis/features/geo/_accessor.py:2433, in GeoAccessor.to_table(self, location, overwrite, **kwargs)
   2431 origin_columns = self._data.columns.tolist()
   2432 origin_index = copy.deepcopy(self._data.index)
-&amp;gt; 2433 location = os.path.abspath(location)
   2434 table = run_and_hide(
   2435     to_table,
   2436     **{
   (...)
   2441     },
   2442 )
   2443 self._data.columns = origin_columns

File /opt/conda/lib/python3.9/posixpath.py:375, in abspath(path)
    373 def abspath(path):
    374     """Return an absolute path."""
--&amp;gt; 375     path = os.fspath(path)
    376     if not isabs(path):
    377         if isinstance(path, bytes):

TypeError: expected str, bytes or os.PathLike object, not GIS&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Sep 2022 19:56:49 GMT</pubDate>
    <dc:creator>ZacharyStanley</dc:creator>
    <dc:date>2022-09-21T19:56:49Z</dc:date>
    <item>
      <title>Output Spatial Dataframe/Dataframe to Table on ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1214594#M7783</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a fairly simple notebook that takes a feature layer and converts it to an sdf and ultimately a df. I would simply like to output this as a table to ArcGIS online.&amp;nbsp; I hope it's a simple path issue, but I'm not optimistic. The other options I've explored are the REST API 'export item' which I've had mixed results with and the idea of using the add() method. The last line in bold is where my question lies. Thanks in advance.&lt;/P&gt;&lt;P&gt;Code shared below:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;from arcgis.gis import GIS&lt;BR /&gt;from IPython.display import display&lt;BR /&gt;import pandas as pd&lt;BR /&gt;from arcgis.features import GeoAccessor, GeoSeriesAccessor&lt;BR /&gt;from arcgis.features import FeatureLayer&lt;BR /&gt;import os&lt;BR /&gt;gis = GIS("home")&lt;/P&gt;&lt;P&gt;lyr_url = '&lt;A href="https://services6.arcgis.com/T8eS7sop5hLmgRRH/arcgis/rest/services/PublicProjectIdeas_ZS/FeatureServer" target="_blank" rel="noopener"&gt;https://services6.arcgis.com/T8eS7sop5hLmgRRH/arcgis/rest/services/PublicProjectIdeas_ZS/FeatureServer&lt;/A&gt;'&lt;BR /&gt;layer = FeatureLayer(lyr_url)&lt;BR /&gt;layer&lt;/P&gt;&lt;P&gt;feature_layer = projIdeas&lt;BR /&gt;feature_layer&lt;/P&gt;&lt;P&gt;query = feature_layer.query()&lt;/P&gt;&lt;P&gt;projIdeasTable = query&lt;BR /&gt;sdf = projIdeasTable.sdf&lt;BR /&gt;sdf.head()&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;projectIdeasTable = sdf.spatial.to_table('ProjectIdeas.csv')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 14:55:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1214594#M7783</guid>
      <dc:creator>ZacharyStanley</dc:creator>
      <dc:date>2022-09-21T14:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Output Spatial Dataframe/Dataframe to Table on ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1214755#M7785</link>
      <description>&lt;P&gt;I'm going to assume from your usage of &lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;GIS("home")&lt;/FONT&gt; you are running this notebook in ArcGIS Pro?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I suspect the csv is being written, but perhaps not where you expect to find it. Add another cell and run this to see the current working directory:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;!echo %cd%&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 18:46:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1214755#M7785</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2022-09-21T18:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Output Spatial Dataframe/Dataframe to Table on ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1214794#M7787</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/86309"&gt;@EarlMedina&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running the notebook on AGOL and get the following results when running your command&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;PRE&gt;/bin/bash: /opt/conda/lib/libtinfo.so.6: no version information available (required by /bin/bash)
%cd%&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Sep 2022 19:41:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1214794#M7787</guid>
      <dc:creator>ZacharyStanley</dc:creator>
      <dc:date>2022-09-21T19:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Output Spatial Dataframe/Dataframe to Table on ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1214801#M7789</link>
      <description>&lt;P&gt;If I set the arguments to my AGOL org account i.e.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis = GIS(url, username, password)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and use to_table method::&lt;/P&gt;&lt;LI-CODE lang="python"&gt;projectIdeasTable = sdf.spatial.to_table(name='ProjectIdeas.csv', location=gis)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this string error:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [73], in &amp;lt;cell line: 1&amp;gt;()
----&amp;gt; 1 projectIdeasTable = sdf.spatial.to_table(name='ProjectIdeas.csv', location=gis)

File /opt/conda/lib/python3.9/site-packages/arcgis/features/geo/_accessor.py:2433, in GeoAccessor.to_table(self, location, overwrite, **kwargs)
   2431 origin_columns = self._data.columns.tolist()
   2432 origin_index = copy.deepcopy(self._data.index)
-&amp;gt; 2433 location = os.path.abspath(location)
   2434 table = run_and_hide(
   2435     to_table,
   2436     **{
   (...)
   2441     },
   2442 )
   2443 self._data.columns = origin_columns

File /opt/conda/lib/python3.9/posixpath.py:375, in abspath(path)
    373 def abspath(path):
    374     """Return an absolute path."""
--&amp;gt; 375     path = os.fspath(path)
    376     if not isabs(path):
    377         if isinstance(path, bytes):

TypeError: expected str, bytes or os.PathLike object, not GIS&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 19:56:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1214801#M7789</guid>
      <dc:creator>ZacharyStanley</dc:creator>
      <dc:date>2022-09-21T19:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Output Spatial Dataframe/Dataframe to Table on ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1215565#M7799</link>
      <description>&lt;P&gt;Oh, I see. I didn't catch that you were running this online. I believe you want to use that method locally if you want to save to a file to disk.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 16:04:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/output-spatial-dataframe-dataframe-to-table-on/m-p/1215565#M7799</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2022-09-23T16:04:05Z</dc:date>
    </item>
  </channel>
</rss>

