<?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: Spatially Enabled DataFrames Returns SHAPE Eeven When Using Fields Filter in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1315100#M8909</link>
    <description>&lt;P&gt;Adding to this thread, it's worth noting that if you explicitly include the SHAPE field in the list of fields you specify, it cause a TypeError. So if you're specifying a subset of fields, make sure you do not include SHAPE in that subset:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;emp_fields = ['SHAPE', 'SECTOR', 'COUNT']
df_i = pd.DataFrame.spatial.from_featureclass(Path(gdb_empinv).joinpath(fc), where_clause=wherecl_emp, sr=sref_sacog, fields=emp_fields)

# Returns TypeError: Expected String or Unicode&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2023 15:30:59 GMT</pubDate>
    <dc:creator>DarrenConly</dc:creator>
    <dc:date>2023-08-03T15:30:59Z</dc:date>
    <item>
      <title>Spatially Enabled DataFrames Returns SHAPE Eeven When Using Fields Filter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1234412#M8047</link>
      <description>&lt;P&gt;Using ArcGIS Python&amp;nbsp;API and Spatially Enabled DataFrames&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import pandas as pd
from arcgis.gis import GIS
fc = "City.gdb\\fire_stations"

sdf3 = pd.DataFrame.spatial.from_featureclass(fc, fields=["ADDRESS","MUN_NAME"])

sdf3.head()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still getting the &lt;STRONG&gt;SHAPE &lt;/STRONG&gt;even though I am passing `&lt;STRONG&gt;fields=["ADDRESS","MUN_NAME"&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;`&amp;nbsp; in the argument to get only [&lt;STRONG&gt;"ADDRESS","MUN_NAME"&lt;/STRONG&gt;] in the df&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="unnamed.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/56674iA47C15CAF72EC82C/image-size/large?v=v2&amp;amp;px=999" role="button" title="unnamed.png" alt="unnamed.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can you please let me know how I can get rid of the SHAPE column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 05:50:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1234412#M8047</guid>
      <dc:creator>geoca</dc:creator>
      <dc:date>2022-11-23T05:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially Enabled DataFrames Returns SHAPE Eeven When Using Fields Filter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1234436#M8050</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#table" target="_blank"&gt;arcgis.features module | ArcGIS API for Python&lt;/A&gt;&lt;/P&gt;&lt;P&gt;perhaps then you don't need a&amp;nbsp;Spatially Enabled DataFrames&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 09:30:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1234436#M8050</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-11-23T09:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially Enabled DataFrames Returns SHAPE Eeven When Using Fields Filter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1234474#M8052</link>
      <description>&lt;P&gt;Agreed! You’re seeing that because you’re using a SEDF&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 14:03:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1234474#M8052</guid>
      <dc:creator>BHeist</dc:creator>
      <dc:date>2022-11-23T14:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially Enabled DataFrames Returns SHAPE Eeven When Using Fields Filter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1236969#M8082</link>
      <description>&lt;P&gt;If you don't want the shape column, you can call this after it's created:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sdf3.drop("SHAPE", axis=1, inplace=True)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Dec 2022 20:18:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1236969#M8082</guid>
      <dc:creator>RogerDunnGIS</dc:creator>
      <dc:date>2022-12-01T20:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially Enabled DataFrames Returns SHAPE Eeven When Using Fields Filter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1315100#M8909</link>
      <description>&lt;P&gt;Adding to this thread, it's worth noting that if you explicitly include the SHAPE field in the list of fields you specify, it cause a TypeError. So if you're specifying a subset of fields, make sure you do not include SHAPE in that subset:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;emp_fields = ['SHAPE', 'SECTOR', 'COUNT']
df_i = pd.DataFrame.spatial.from_featureclass(Path(gdb_empinv).joinpath(fc), where_clause=wherecl_emp, sr=sref_sacog, fields=emp_fields)

# Returns TypeError: Expected String or Unicode&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 15:30:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframes-returns-shape-eeven/m-p/1315100#M8909</guid>
      <dc:creator>DarrenConly</dc:creator>
      <dc:date>2023-08-03T15:30:59Z</dc:date>
    </item>
  </channel>
</rss>

