<?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: How to find which features in an SEDF cause .to_featureset() to fail? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-find-which-features-in-an-sedf-cause-to/m-p/1403928#M9827</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Sorry, had to reread what you did and said earlier. I am curious what happens if you split the df into chunks. There are a number of ways to do this, but one fairly simple way to do this might be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;n = 10
df_list = [df[i:i+n] for i in range(0,len(df),n)] # Break up into groups of ten

for i, df in enumerate(df_list):
    start_idx = i * n
    print(f"Records {start_idx} through {start_idx + n - 1}")
    df.spatial.to_featureset()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have seen that method fail because of illegal values, but never have I seen it behave in the manner you describe.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Apr 2024 17:06:08 GMT</pubDate>
    <dc:creator>EarlMedina</dc:creator>
    <dc:date>2024-04-01T17:06:08Z</dc:date>
    <item>
      <title>How to find which features in an SEDF cause .to_featureset() to fail?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-find-which-features-in-an-sedf-cause-to/m-p/1401406#M9812</link>
      <description>&lt;P&gt;I have a spatially enabled data frame with 20,000 features.&lt;/P&gt;&lt;P&gt;When I run `sedf.spatial.to_featureset()`, it fails with this error:&lt;/P&gt;&lt;PRE&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "C:\Users\User\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\geo\_accessor.py", line 3680, in to_featureset&lt;BR /&gt;d = self.__feature_set__&lt;BR /&gt;File "C:\Users\User\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\geo\_accessor.py", line 3339, in __feature_set__&lt;BR /&gt;geom_type = _geom_types[&lt;BR /&gt;KeyError: &amp;lt;class 'pandas.core.series.Series'&amp;gt;&lt;/PRE&gt;&lt;P&gt;When run the same command on random samples from the dataset, it works fine. E.g.&lt;/P&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; sedf.sample(200).spatial.to_featureset()&lt;BR /&gt;&amp;lt;FeatureSet&amp;gt; 200 features&lt;/PRE&gt;&lt;P&gt;Is there any way to find out which feature(s) are causing the error with to_featureset(), to narrow down what the issue might be?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 13:30:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-find-which-features-in-an-sedf-cause-to/m-p/1401406#M9812</guid>
      <dc:creator>A_Schwab</dc:creator>
      <dc:date>2024-03-27T13:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to find which features in an SEDF cause .to_featureset() to fail?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-find-which-features-in-an-sedf-cause-to/m-p/1401862#M9819</link>
      <description>&lt;P&gt;After some testing, the issue is in the first 30 features. to_featureset() works fine for all the rows after row 30:&lt;/P&gt;&lt;PRE&gt;&amp;gt;&amp;gt; sedf[30:20000].spatial.to_featureset()&lt;BR /&gt;&amp;lt;FeatureSet&amp;gt; 19970 features&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running to_featureset() on the first 30 rows still gives an error:&lt;/P&gt;&lt;PRE&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "C:\Users\User\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\geo\_accessor.py", line 3680, in to_featureset&lt;BR /&gt;d = self.__feature_set__&lt;BR /&gt;File "C:\Users\User\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\geo\_accessor.py", line 3339, in __feature_set__&lt;BR /&gt;geom_type = _geom_types[&lt;BR /&gt;KeyError: &amp;lt;class 'pandas.core.series.Series'&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, running the same command on subsets of the first 30 rows produces no error:&lt;/P&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; sedf[0:10].spatial.to_featureset()&lt;BR /&gt;&amp;lt;FeatureSet&amp;gt; 10 features&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; sedf[10:20].spatial.to_featureset()&lt;BR /&gt;&amp;lt;FeatureSet&amp;gt; 10 features&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; sedf[20:30].spatial.to_featureset()&lt;BR /&gt;&amp;lt;FeatureSet&amp;gt; 10 features&lt;/PRE&gt;&lt;P&gt;I've exported the 30 records to CSV and looked through them, and can't see anything obvious that would cause them to trigger an error.&lt;/P&gt;&lt;P&gt;Anyone have any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 10:21:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-find-which-features-in-an-sedf-cause-to/m-p/1401862#M9819</guid>
      <dc:creator>A_Schwab</dc:creator>
      <dc:date>2024-03-28T10:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to find which features in an SEDF cause .to_featureset() to fail?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-find-which-features-in-an-sedf-cause-to/m-p/1403928#M9827</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Sorry, had to reread what you did and said earlier. I am curious what happens if you split the df into chunks. There are a number of ways to do this, but one fairly simple way to do this might be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;n = 10
df_list = [df[i:i+n] for i in range(0,len(df),n)] # Break up into groups of ten

for i, df in enumerate(df_list):
    start_idx = i * n
    print(f"Records {start_idx} through {start_idx + n - 1}")
    df.spatial.to_featureset()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have seen that method fail because of illegal values, but never have I seen it behave in the manner you describe.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 17:06:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-find-which-features-in-an-sedf-cause-to/m-p/1403928#M9827</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2024-04-01T17:06:08Z</dc:date>
    </item>
  </channel>
</rss>

