<?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 Handling blank values not converting string to float with NumPy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/handling-blank-values-not-converting-string-to/m-p/485810#M37899</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A web-service is returning blank values in lat/long causing ValueError: could not convert string to float:&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;34.0746400246
-118.37200592


34.0968797927
-118.449631186
34.0635760772
-118.327509298
34.0635760772
-118.327509298
34.0746400246
-118.37200592
34.0828880733
-118.320862797
34.0828880733&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; requests
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; json
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; jsonpickle

f2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;open&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'C:\Users\GeoffreyWest\Desktop\Request.json'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
data2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; jsonpickle&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;decode&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;((&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;f2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;read&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;()))&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
data2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; jsonpickle&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;encode&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;data2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
fc&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;aFC&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;



&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; data2
url2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;"url"&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
headers2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Content-type'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'text/plain'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Accept'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'/'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;}&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

r2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; requests&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;post&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;url2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; data&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;data2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; headers&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;headers2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
decoded2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; json&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;loads&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;r2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;text&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; json&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;dumps&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;decoded2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sort_keys&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;True&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; indent&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="lit" style="color: #800000;"&gt;4&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;Exists&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;fc&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;):&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;Delete_management&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;fc&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;try&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; r2
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;except&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; requests&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;exceptions&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;ConnectTimeout&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;as&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; e&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;"Too slow Mojo!"&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

items &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[]&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;for&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sr &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;in&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; decoded2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Response'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;][&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'ListOfServiceRequest'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;][&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'ServiceRequest'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;]:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;SRAddress&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sr&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'SRAddress'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; lat &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;"3"&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; y &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sr&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Latitude'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; x &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sr&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Longitude'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; str_list &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; filter&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; y&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; str_list2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; filter&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; x&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; str_list
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; str_list2



&amp;nbsp; dt &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; np&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;dtype&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;([(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'LatitudeShape'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'&amp;lt;f8'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'LongitudeShape'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'&amp;lt;f8'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Latitude'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'&amp;lt;f8'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Longitude'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'&amp;lt;f8'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;])&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

&amp;nbsp; items&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;append&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;((&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;str_list2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; str_list&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; str_list2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; str_list&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;))&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

&amp;nbsp; sr &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;SpatialReference&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit" style="color: #800000;"&gt;4326&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

arr &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; np&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;array&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;items&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;dtype&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;dt&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;NumPyArray&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;da&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;NumPyArrayToFeatureClass&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;arr&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; fc&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'longitudeshape'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'latitudeshape'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;],&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sr&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;"success"&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:24:47 GMT</pubDate>
    <dc:creator>GeoffreyWest1</dc:creator>
    <dc:date>2021-12-11T21:24:47Z</dc:date>
    <item>
      <title>Handling blank values not converting string to float with NumPy</title>
      <link>https://community.esri.com/t5/python-questions/handling-blank-values-not-converting-string-to/m-p/485810#M37899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A web-service is returning blank values in lat/long causing ValueError: could not convert string to float:&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;34.0746400246
-118.37200592


34.0968797927
-118.449631186
34.0635760772
-118.327509298
34.0635760772
-118.327509298
34.0746400246
-118.37200592
34.0828880733
-118.320862797
34.0828880733&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; requests
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; json
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; jsonpickle

f2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;open&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'C:\Users\GeoffreyWest\Desktop\Request.json'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
data2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; jsonpickle&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;decode&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;((&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;f2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;read&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;()))&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
data2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; jsonpickle&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;encode&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;data2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
fc&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;aFC&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;



&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; data2
url2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;"url"&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
headers2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Content-type'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'text/plain'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Accept'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'/'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;}&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

r2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; requests&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;post&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;url2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; data&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;data2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; headers&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;headers2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
decoded2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; json&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;loads&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;r2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;text&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; json&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;dumps&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;decoded2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sort_keys&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;True&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; indent&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="lit" style="color: #800000;"&gt;4&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;Exists&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;fc&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;):&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;Delete_management&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;fc&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;try&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; r2
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;except&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; requests&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;exceptions&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;ConnectTimeout&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;as&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; e&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;"Too slow Mojo!"&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

items &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[]&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;for&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sr &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;in&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; decoded2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Response'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;][&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'ListOfServiceRequest'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;][&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'ServiceRequest'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;]:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;SRAddress&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sr&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'SRAddress'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; lat &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;"3"&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; y &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sr&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Latitude'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; x &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sr&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Longitude'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; str_list &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; filter&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; y&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; str_list2 &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; filter&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; x&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; str_list
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; str_list2



&amp;nbsp; dt &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; np&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;dtype&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;([(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'LatitudeShape'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'&amp;lt;f8'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'LongitudeShape'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'&amp;lt;f8'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Latitude'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'&amp;lt;f8'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'Longitude'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'&amp;lt;f8'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;),&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;])&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

&amp;nbsp; items&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;append&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;((&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;str_list2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; str_list&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; str_list2&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp; str_list&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;))&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

&amp;nbsp; sr &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;SpatialReference&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit" style="color: #800000;"&gt;4326&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

arr &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; np&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;array&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;items&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;dtype&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;dt&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;

&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;NumPyArray&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;da&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #2b91af;"&gt;NumPyArrayToFeatureClass&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;arr&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; fc&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'longitudeshape'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;'latitudeshape'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;],&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; sr&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;
&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #00008b;"&gt;print&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #800000;"&gt;"success"&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:24:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/handling-blank-values-not-converting-string-to/m-p/485810#M37899</guid>
      <dc:creator>GeoffreyWest1</dc:creator>
      <dc:date>2021-12-11T21:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Handling blank values not converting string to float with NumPy</title>
      <link>https://community.esri.com/t5/python-questions/handling-blank-values-not-converting-string-to/m-p/485811#M37900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you paste the specific error message, the actual text returned?&amp;nbsp; It would be helpful to know what function or method is actually raising the error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 15:53:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/handling-blank-values-not-converting-string-to/m-p/485811#M37900</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-05-13T15:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Handling blank values not converting string to float with NumPy</title>
      <link>https://community.esri.com/t5/python-questions/handling-blank-values-not-converting-string-to/m-p/485812#M37901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After a quick check, I am guessing it is Line 53 of your code snippet that is throwing the error.&amp;nbsp; I guess my first question is whether you want to rely on implicit type conversion?&amp;nbsp; Python doesn't natively support implicit type conversion, and the &lt;A href="https://www.python.org/dev/peps/pep-0020/"&gt;Zen of Python&lt;/A&gt; states "explicit is better than implicit."&amp;nbsp; Even though NumPy's array constructor supports implicit type conversion, I would argue relying on it is not very Pythonic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are you trying to achieve with Lines 32 &amp;amp; 33?&amp;nbsp; If you explicitly convert strings to numbers and empty strings to None, I think the code will stop throwing errors at Line 53.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 18:14:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/handling-blank-values-not-converting-string-to/m-p/485812#M37901</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-05-13T18:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Handling blank values not converting string to float with NumPy</title>
      <link>https://community.esri.com/t5/python-questions/handling-blank-values-not-converting-string-to/m-p/485813#M37902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order to use numpy arrays with null values, you have to implement masked arrays and not typical ndarrays.&amp;nbsp; The documentation on masked arrays is quite good but there are some tricks particularly if your input data contains a mix of numbers and text, in which case, your dtype should be 'object'.&amp;nbsp; A couple of illustrations follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; import numpy as np
&amp;gt;&amp;gt;&amp;gt; x = np.array([1, 2, 3, np.nan, 5, np.nan, 7,8, np.nan])
&amp;gt;&amp;gt;&amp;gt; y = np.ma.masked_array(x, np.isnan(x))
&amp;gt;&amp;gt;&amp;gt; y
masked_array(data = [1.0 2.0 3.0 -- 5.0 -- 7.0 8.0 --],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mask = [False False False&amp;nbsp; True False&amp;nbsp; True False False&amp;nbsp; True],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fill_value = 1e+20)
&amp;gt;&amp;gt;&amp;gt; u = np.array(['a', 2, 'c', "", 'e', "", 7, 'g', ""],dtype=object)
&amp;gt;&amp;gt;&amp;gt; u = np.ma.masked_values(u,"")
&amp;gt;&amp;gt;&amp;gt; u
masked_array(data = ['a' 2 'c' -- 'e' -- 7 'g' --],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mask = [False False False&amp;nbsp; True False&amp;nbsp; True False False&amp;nbsp; True],
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fill_value = ?)
&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may be of help depending upon your data structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the x,y example, the array 'null' values were represented as np.nan's this could be other numbers such as -9999 etc.&lt;/P&gt;&lt;P&gt;In the u,v example, the array is a mix of text and numbers and an empty string is used to represent null values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:24:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/handling-blank-values-not-converting-string-to/m-p/485813#M37902</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T21:24:50Z</dc:date>
    </item>
  </channel>
</rss>

