<?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: pd.DataFrame.spatial.from_table() is loading column labels but not data? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/1024609#M5526</link>
    <description>&lt;P&gt;I'm not entirely sure the solution response is the entire picture. It appears to me to be a failure of spatial.from_table to deal with null values.&lt;/P&gt;&lt;P&gt;The default behavior looks like it will cut down the rows it actually reads into the dataframe such that it can have at least one complete row of non-null data that includes values from all specified fields. So as you add more fields to the list the chances of an entire row containing non-null values diminishes.&lt;/P&gt;&lt;P&gt;Therefore specifying fields probably means also excluding many fields you don't care about. That explains why specifying fields works. If you used&amp;nbsp;arcpy.ListFields() and built a list of all field names it should behave the same as default where no fields are entered, which is the same as fields='*'.&lt;/P&gt;&lt;P&gt;So to handle this behavior you can add something like&amp;nbsp;null_value='-9999' and then in the dataframe switch that value back to NaN if that is desired.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Feb 2021 20:50:28 GMT</pubDate>
    <dc:creator>Hudi</dc:creator>
    <dc:date>2021-02-08T20:50:28Z</dc:date>
    <item>
      <title>pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861603#M4202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as the title says, trying to access a local file in a GDB, a dataframe is created with the correct number of columns but no data?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;import pandas as pd&lt;BR /&gt;from arcgis.features import GeoAccessor, GeoSeriesAccessor&lt;BR /&gt;from arcgis import GIS&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;df = pd.DataFrame.spatial.from_table(r'some_file_path_to_a_table_in_a_gdb')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;df.shape&lt;/P&gt;&lt;P&gt;output: 0 x number of cols in input table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 15:19:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861603#M4202</guid>
      <dc:creator>SamuelStroebel</dc:creator>
      <dc:date>2020-11-10T15:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861604#M4203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It always helps to show your code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 16:42:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861604#M4203</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-11-10T16:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861605#M4204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks, updated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 16:49:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861605#M4204</guid>
      <dc:creator>SamuelStroebel</dc:creator>
      <dc:date>2020-11-10T16:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861606#M4205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What version of the ArcGIS API for Python are you using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 16:52:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861606#M4205</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-11-10T16:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861607#M4206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.8.2, in a cloned environment&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 16:56:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861607#M4206</guid>
      <dc:creator>SamuelStroebel</dc:creator>
      <dc:date>2020-11-10T16:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861608#M4207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see what you are running into, clearly a defect.&amp;nbsp; To work around it, specify the fields you want in a field list, and it will work.&amp;nbsp; It appears the wildcard for all fields isnt' working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 17:02:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861608#M4207</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-11-10T17:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861609#M4208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your work around worked perfectly, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 17:09:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861609#M4208</guid>
      <dc:creator>SamuelStroebel</dc:creator>
      <dc:date>2020-11-10T17:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861610#M4209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please mark my response as Correct to close out the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I opened in issue on GitHub:&amp;nbsp; &lt;A class="link-titled" href="https://github.com/Esri/arcgis-python-api/issues/829" title="https://github.com/Esri/arcgis-python-api/issues/829"&gt;GeoAccessor.from_table Returns Empty Table When Using All Fields Wildcard · Issue #829 · Esri/arcgis-python-api · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 17:23:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/861610#M4209</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-11-10T17:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/1024609#M5526</link>
      <description>&lt;P&gt;I'm not entirely sure the solution response is the entire picture. It appears to me to be a failure of spatial.from_table to deal with null values.&lt;/P&gt;&lt;P&gt;The default behavior looks like it will cut down the rows it actually reads into the dataframe such that it can have at least one complete row of non-null data that includes values from all specified fields. So as you add more fields to the list the chances of an entire row containing non-null values diminishes.&lt;/P&gt;&lt;P&gt;Therefore specifying fields probably means also excluding many fields you don't care about. That explains why specifying fields works. If you used&amp;nbsp;arcpy.ListFields() and built a list of all field names it should behave the same as default where no fields are entered, which is the same as fields='*'.&lt;/P&gt;&lt;P&gt;So to handle this behavior you can add something like&amp;nbsp;null_value='-9999' and then in the dataframe switch that value back to NaN if that is desired.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 20:50:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/1024609#M5526</guid>
      <dc:creator>Hudi</dc:creator>
      <dc:date>2021-02-08T20:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/1072021#M6262</link>
      <description>&lt;P&gt;I've confirmed this is the actual issue. I supplied my fields via a list from arcpy.ListFields() to no avail. Using the null_value is what actually made it work for me.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:21:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/1072021#M6262</guid>
      <dc:creator>gallgher55</dc:creator>
      <dc:date>2021-06-24T14:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: pd.DataFrame.spatial.from_table() is loading column labels but not data?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/1238367#M8114</link>
      <description>&lt;P&gt;skip_nulls=False also worked for me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;df = pd.DataFrame.spatial.from_table(filename=os.path.join(sde,"Table"),skip_nulls=False)&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 16:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/pd-dataframe-spatial-from-table-is-loading-column/m-p/1238367#M8114</guid>
      <dc:creator>EricAnderson_DHS</dc:creator>
      <dc:date>2022-12-06T16:58:52Z</dc:date>
    </item>
  </channel>
</rss>

