Hi~~~~
if arg.endswith("산"):
return 3
Help me please....
do you have multiple instances of the table open? close down all your ArcGIS applications and open up a fresh mxd then retry.
There must be an invisible error in the layer.It's solved by using a different layer.Thanks for your help.
Thank you for your reply.
Hi, try adding an else statement to handle the bulk of the values which don't meet the condition.
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">Reclass</SPAN><SPAN class="punctuation token">(</SPAN>arg<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">if</SPAN> arcg<SPAN class="punctuation token">.</SPAN>endswith<SPAN class="punctuation token">(</SPAN><SPAN class="string token">""</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="string token">"3"</SPAN> <SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">return</SPAN> arg<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
return 3 is a number and will produce an error
return "3" or return str(3) .... will return a string representation of a number which you can use in that field
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.