<?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: Table To NumPyArray consistent error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/table-to-numpyarray-consistent-error/m-p/1556546#M73155</link>
    <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/tabletonumpyarray.htm" target="_blank"&gt;TableToNumPyArray—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;is there a chance that you have nulls/missing values in your dataset (particularly in your integer fields) that need to be evaluated and replaced as per the example in the help topic?&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2024 21:22:00 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2024-11-07T21:22:00Z</dc:date>
    <item>
      <title>Table To NumPyArray consistent error</title>
      <link>https://community.esri.com/t5/python-questions/table-to-numpyarray-consistent-error/m-p/1556530#M73154</link>
      <description>&lt;P&gt;I have a script that calculates several fields in a table, then publishes that table to a sql server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use pandas to publish to the sql server, I create the pandas data frame using a numpy array.&lt;/P&gt;&lt;P&gt;I use arcpy.da.TableToNumpyArray() to create the dataframe.&lt;/P&gt;&lt;P&gt;Whenever line 6 is run I receive a type error int() argument must be a string, a bytes-like object or a number, not 'NoneType'.&lt;/P&gt;&lt;P&gt;See code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Childcare = mp.listTables("Childcare_Coordinates")[0] #create table variable
Fields = [f.name for f in arcpy.ListFields(Childcare)] #gets field names
Fields.pop(0) #removes objectid

#create NumpyArray
NumpyArray = arcpy.da.TableToNumPyArray(Childcare, Fields, skip_nulls = False)

#Covert NumpyArray to Pandas Dataframe
df = pd.DataFrame(NumpyArray)
#rename objectid to objectid_1
df = df.rename(columns = {"objectid_1": "objectid"})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Every other piece functions as it should with these two variable except line 6. Why&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrandonMcAlister_0-1731013137755.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/119087i42726DF64FCA350D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BrandonMcAlister_0-1731013137755.png" alt="BrandonMcAlister_0-1731013137755.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This has worked in the past, then one day it woke up and said I don't want to be friends with you any more. It is not isolated to this table, it is all tables.&lt;BR /&gt;&lt;BR /&gt;I have tried to reference the table from a workspace instead of a map as well. Same error&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 21:12:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-numpyarray-consistent-error/m-p/1556530#M73154</guid>
      <dc:creator>BrandonMcAlister</dc:creator>
      <dc:date>2024-11-07T21:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Table To NumPyArray consistent error</title>
      <link>https://community.esri.com/t5/python-questions/table-to-numpyarray-consistent-error/m-p/1556546#M73155</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/tabletonumpyarray.htm" target="_blank"&gt;TableToNumPyArray—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;is there a chance that you have nulls/missing values in your dataset (particularly in your integer fields) that need to be evaluated and replaced as per the example in the help topic?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 21:22:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-numpyarray-consistent-error/m-p/1556546#M73155</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-11-07T21:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Table To NumPyArray consistent error</title>
      <link>https://community.esri.com/t5/python-questions/table-to-numpyarray-consistent-error/m-p/1556636#M73156</link>
      <description>&lt;P&gt;I think Dan is right about nulls , null_value=0&lt;SPAN&gt;&amp;nbsp;replaces&amp;nbsp;&lt;/SPAN&gt;None&lt;SPAN&gt;&amp;nbsp;values with&amp;nbsp;&lt;/SPAN&gt;0&lt;SPAN&gt;. Adjust this value based on your data requirements.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;arcpy.ListTables("Childcare_Coordinates")[0]  # Create table variable
Fields = [f.name for f in arcpy.ListFields(Childcare)]  # Get field names
Fields.pop(0)  # Remove objectid

# Create NumpyArray with null_value parameter
NumpyArray = arcpy.da.TableToNumPyArray(Childcare, Fields, skip_nulls=False, null_value=0)

# Convert NumpyArray to Pandas DataFrame
df = pd.DataFrame(NumpyArray)
# Rename objectid to objectid_1
df = df.rename(columns={"objectid_1": "objectid"})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 22:54:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-numpyarray-consistent-error/m-p/1556636#M73156</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2024-11-07T22:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Table To NumPyArray consistent error</title>
      <link>https://community.esri.com/t5/python-questions/table-to-numpyarray-consistent-error/m-p/1556797#M73163</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3265"&gt;@TonyAlmeida&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution works Tony, it would appear that two fields that were once text fields are now int fields. Which explains why it worked previously then suddenly stopped. When we recreated the tables we changed the field type of text to int.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 15:33:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/table-to-numpyarray-consistent-error/m-p/1556797#M73163</guid>
      <dc:creator>BrandonMcAlister</dc:creator>
      <dc:date>2024-11-08T15:33:10Z</dc:date>
    </item>
  </channel>
</rss>

