<?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: Convert data frame to stand alone table in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1521647#M86989</link>
    <description>&lt;P&gt;I couldn't seem to edit my previous comment, so to follow with a script edit. I actually needed to enter a the desired string field length on line 4 below.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dtypes = {}
for col,type in df.dtypes.items():
    if str(type) == 'object':
        dtypes[col] = f'U255'
    else:
        dtypes[col] = type
array = df.to_records(column_dtypes=dtypes)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 14 Aug 2024 17:22:50 GMT</pubDate>
    <dc:creator>BenCapell_NWTF10</dc:creator>
    <dc:date>2024-08-14T17:22:50Z</dc:date>
    <item>
      <title>Convert data frame to stand alone table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1091036#M44713</link>
      <description>&lt;P&gt;Hello, we are exploring the use of ArcGIS Notebook within ArcGIS Pro and was hoping this community could help with a problem we have run into.&amp;nbsp; Our ultimate goal is to retreive data from a Google Sheet we use and join that data to a feature layer (polygon) within ArcGIS Pro, which we will then look to automate web publishing to one of our ArcGIS Online maps.&amp;nbsp; I have had someone develop some python that retreives our Google Sheet data (see attached).&amp;nbsp; We are trying to figure out how to convert this data frame to a stand alone table so that we can join with our feature layer.&amp;nbsp; We wanted to see if this is possible?&amp;nbsp; If not, we were thinking that we need to some how execute the join between the feature layer and the Google Sheet (now in our data frame) all through ArcGIS Notebook, if possible.&amp;nbsp; Please note both the Google Sheet data and feature layer will be update frequently so we are trying to automate this process.&amp;nbsp; Any advise is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Sat, 21 Aug 2021 12:10:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1091036#M44713</guid>
      <dc:creator>LCS123</dc:creator>
      <dc:date>2021-08-21T12:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data frame to stand alone table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1092952#M44890</link>
      <description>&lt;P&gt;Is this a pandas dataframe?&lt;/P&gt;&lt;P&gt;You can probably use &lt;FONT face="courier new,courier"&gt;to_records&lt;/FONT&gt; (&lt;A href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_records.html" target="_blank" rel="noopener"&gt;https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_records.html&lt;/A&gt;) to create a numpy structured (aka record) array, t&lt;SPAN&gt;hen use &lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;arcpy.NumPyArrayToTable&lt;/FONT&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/numpyarraytotable.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/numpyarraytotable.htm&lt;/A&gt;&lt;SPAN&gt;). I'll let you guys work out the details, since this might need some massaging!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hope this gets you unstuck!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 22:22:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1092952#M44890</guid>
      <dc:creator>HannesZiegler</dc:creator>
      <dc:date>2021-08-26T22:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data frame to stand alone table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1095284#M45182</link>
      <description>&lt;P&gt;HannesZiegler, first off, thank you for taking a look at this!&amp;nbsp; We've had some delays here in Louisiana given the Ida impacts but I am actually trying to troubleshoot myself (to help build my own Python literacy).&amp;nbsp; I've converted our Dataframe to a rec.array using the first step.&amp;nbsp; Still having trouble running NumPyArraytoTable as seen in the attached.&amp;nbsp; I'll have our python expert take a look at this once he is back up in running.&amp;nbsp; Will keep you posted.&amp;nbsp; Thanks again!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 13:26:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1095284#M45182</guid>
      <dc:creator>LCS123</dc:creator>
      <dc:date>2021-09-03T13:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data frame to stand alone table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1095299#M45184</link>
      <description>&lt;P&gt;Glad to help! I hope all is well, Ida battered quite a few places..&lt;/P&gt;&lt;P&gt;Regarding your error, you've got a bunch of 'O' (object) data types in the structured array, and you need to set those to the appropriate data type - see my response on an old thread&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-questions/arcpy-da-numpyarraytotable-returns-quot/m-p/1027773/highlight/true#M60021" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 14:19:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1095299#M45184</guid>
      <dc:creator>HannesZiegler</dc:creator>
      <dc:date>2021-09-03T14:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data frame to stand alone table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1104571#M46339</link>
      <description>&lt;P&gt;Thank you, HannesZiegler!&amp;nbsp; It worked!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 20:41:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1104571#M46339</guid>
      <dc:creator>LCS123</dc:creator>
      <dc:date>2021-10-04T20:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data frame to stand alone table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1521642#M86988</link>
      <description>&lt;P&gt;Thank you for this contribution. I am utilizing this concept of converting pd.DataFrame to GDB Table as part of a larger workflow that moves queried database records into a .gdb as a table participating in a relationship class with a feature class.&lt;BR /&gt;To accomplish the pd.DataFrame to GDB Table step: first the pd.DataFrame must become a numpy.array with df.to_records(). Then the array is converted to GDB Table with arcpy.da.NumPyArrayToTable(array, table_path). The snag, as noted, is that the data type 'object'/'O' can't be inferred by GDB Table fields when reading the numpy.array. I declared the 'object' data type as string for each column using the process below to convert columns with the 'O' type into String fields. Note that if some other field type should be applied for a field that is typed as 'O' then the code will need adjusting. Hope this helps the next viewer of this thread!&lt;/P&gt;&lt;P&gt;numpy data types ref: &lt;A href="https://numpy.org/doc/stable/user/basics.types.html#data-types-for-strings-and-bytes" target="_blank"&gt;https://numpy.org/doc/stable/user/basics.types.html#data-types-for-strings-and-bytes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dtypes = {}
for col,type in df.dtypes.items():
    if str(type) == 'object':
        dtypes[col] = f'U{len(col)}'
    else:
        dtypes[col] = type
array = df.to_records(column_dtypes=dtypes)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2024 17:13:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1521642#M86988</guid>
      <dc:creator>BenCapell_NWTF10</dc:creator>
      <dc:date>2024-08-14T17:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data frame to stand alone table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1521647#M86989</link>
      <description>&lt;P&gt;I couldn't seem to edit my previous comment, so to follow with a script edit. I actually needed to enter a the desired string field length on line 4 below.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dtypes = {}
for col,type in df.dtypes.items():
    if str(type) == 'object':
        dtypes[col] = f'U255'
    else:
        dtypes[col] = type
array = df.to_records(column_dtypes=dtypes)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Aug 2024 17:22:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1521647#M86989</guid>
      <dc:creator>BenCapell_NWTF10</dc:creator>
      <dc:date>2024-08-14T17:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data frame to stand alone table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1521772#M86994</link>
      <description>&lt;P&gt;Hey all, you can also use apache arrow to potentially convert from Pandas DataFrame to GDB Table more easily, see&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-pro/developers/leverage-apache-arrow-in-arcgis-pro/" target="_blank"&gt;Leverage Apache Arrow in ArcGIS Pro (esri.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2024 19:45:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1521772#M86994</guid>
      <dc:creator>HannesZiegler</dc:creator>
      <dc:date>2024-08-14T19:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data frame to stand alone table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1642334#M98260</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/775559"&gt;@BenCapell_NWTF10&lt;/a&gt;&amp;nbsp; This solved my problem, thanks!&lt;/P&gt;&lt;P&gt;I had converted an Excel sheet to pandas dataframe, made some tweaks, and then wanted to convert the dataframe to an ArcGIS standalone table. Even though I had set the column data types to "str" when converting from Excel to pandas, apparently the string fields were still "object" data types. So this fix allowed me to convert to ArcGIS table with appropriate field data types!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 13:49:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-data-frame-to-stand-alone-table/m-p/1642334#M98260</guid>
      <dc:creator>MatthewLeonard</dc:creator>
      <dc:date>2025-08-15T13:49:07Z</dc:date>
    </item>
  </channel>
</rss>

