<?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: Python error: use &amp;quot;*&amp;quot; in a function parameter  in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706424#M54740</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a suggestion, when you are using parameters, read their case requirements explicitly&lt;/P&gt;&lt;P&gt;in your case&lt;/P&gt;&lt;P&gt;FeatureClassToNumPyArray (in_table, field_names, {where_clause}, {spatial_reference}, {explode_to_points}, {skip_nulls}, {null_value}). &amp;nbsp;&lt;/P&gt;&lt;P&gt;The keyword arguments (**kwargs) already has a default. &amp;nbsp;It has been my experience also, that if a kwarg has a default, don't specify it. &amp;nbsp;The default should really be an empty list/tuple and not a string, which it does. &amp;nbsp;You would have obtained all the fields if you had left out your second parameter altogether OR specified all the field names within a tuple as James showed you how to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Sep 2016 19:05:17 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2016-09-22T19:05:17Z</dc:date>
    <item>
      <title>Python error: use "*" in a function parameter</title>
      <link>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706419#M54735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using this function:&lt;/P&gt;&lt;P&gt;arcpy.da.FeatureClassToNumPyArray(featureClass, "*")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With an asterisk in the second parameter I get this error in Pyscripter:&lt;/P&gt;&lt;P&gt;TypeError: long() argument must be a string or a number, not 'NoneType' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While when I put the name of a field or a some fields I have no problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to ESRI help, this parameter can be populated with:&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; font-size: 14px; margin-top: 0em;"&gt;A list (or tuple) of field names. For a single field, you can use a string instead of a list of strings.&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; font-size: 14px; margin-top: 0em;"&gt;Or use an asterisk (&lt;SPAN class=""&gt;*&lt;/SPAN&gt;) instead of a list of fields if you want to access all fields from the input table.&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; font-size: 14px; margin-top: 0em;"&gt;&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; font-size: 14px; margin-top: 0em;"&gt;What am I doing wrong?&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; font-size: 14px; margin-top: 0em;"&gt;&lt;/P&gt;&lt;P style="color: #4d4d4d; background-color: #ffffff; font-size: 14px; margin-top: 0em;"&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 12:52:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706419#M54735</guid>
      <dc:creator>ArnauForner</dc:creator>
      <dc:date>2016-09-22T12:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Python error: use "*" in a function parameter</title>
      <link>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706420#M54736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's wrong with listing out the fields?&amp;nbsp; It's&amp;nbsp;a good practice to be explicit in the fields you want to work with anyway.&amp;nbsp; However, if you must use all of the fields then you can just easily build a list of them:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;eflds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MyFeatureclass&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 13:01:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706420#M54736</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2016-09-22T13:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python error: use "*" in a function parameter</title>
      <link>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706421#M54737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mention passing a field or some fields, what if you pass all fields like &lt;A href="https://community.esri.com/people/jamesfreddyc"&gt;jamesfreddyc&lt;/A&gt;‌ suggests?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error suggests that a NULL in the data (which is returned as NoneType) is failing to be coerced into a Long data type.&amp;nbsp; In order to troubleshoot anymore, the field that contains the problematic data needs to be isolated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does your feature class contain any NULL or empty geometries?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 15:08:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706421#M54737</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-09-22T15:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Python error: use "*" in a function parameter</title>
      <link>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706422#M54738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joshua, I found a null value in one of the fields&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 15:41:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706422#M54738</guid>
      <dc:creator>ArnauForner</dc:creator>
      <dc:date>2016-09-22T15:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Python error: use "*" in a function parameter</title>
      <link>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706423#M54739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at the skip_nulls and null_value parameters in the documentation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 16:39:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706423#M54739</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-09-22T16:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Python error: use "*" in a function parameter</title>
      <link>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706424#M54740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a suggestion, when you are using parameters, read their case requirements explicitly&lt;/P&gt;&lt;P&gt;in your case&lt;/P&gt;&lt;P&gt;FeatureClassToNumPyArray (in_table, field_names, {where_clause}, {spatial_reference}, {explode_to_points}, {skip_nulls}, {null_value}). &amp;nbsp;&lt;/P&gt;&lt;P&gt;The keyword arguments (**kwargs) already has a default. &amp;nbsp;It has been my experience also, that if a kwarg has a default, don't specify it. &amp;nbsp;The default should really be an empty list/tuple and not a string, which it does. &amp;nbsp;You would have obtained all the fields if you had left out your second parameter altogether OR specified all the field names within a tuple as James showed you how to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 19:05:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-error-use-quot-quot-in-a-function-parameter/m-p/706424#M54740</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-22T19:05:17Z</dc:date>
    </item>
  </channel>
</rss>

