<?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: Splitting String at ',' accounting for No Data in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445691#M34906</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In terms of style, &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;None&lt;/SPAN&gt; is a singleton so the idiomatic way to work with it is &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;var is None&lt;/SPAN&gt;.&amp;nbsp; For the Task1 field, I would go with:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;!MaintenanceTasks!&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;','&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; !MaintenanceTasks! &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; None&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For the Task2 field, I would try:&lt;/P&gt;&lt;PRE class="language-none"&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;!MaintenanceTasks!.split(',')[1] if !MaintenanceTasks! and ',' in !MaintenanceTasks! else None‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jan 2019 19:07:43 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2019-01-10T19:07:43Z</dc:date>
    <item>
      <title>Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445689#M34904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got a table with a field named Maintenance Tasks. I would like to parse the values in this field into separate fields (Task1, Task2 etc.):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/432961_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;EM&gt;None if !MaintenanceTasks! == None else !MaintenanceTasks!.split(',')[0]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and this will parse the first item correctly into Task1, it also accounts for any null values in MaintenanceTasks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I'm running into is, for example, OID 23 above, when there's just a single item in the MaintenanceTasks field (ReplaceHead).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated. FWIW I'll be scripting in Python.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 18:44:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445689#M34904</guid>
      <dc:creator>deleted-user-qpvAI3Fo0MKR</dc:creator>
      <dc:date>2019-01-10T18:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445690#M34905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'a, b'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'c'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; a&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# ---- split works properly, always returning a list&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;","&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'a'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' b'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'c'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; a&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# ---- as evidenced below&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;","&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
a
c&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can always use a code block rather than the 'smokin' one-liner&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;splitter&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;""" """&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; None
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;','&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# ---- expression&lt;/SPAN&gt;
splitter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;!YourFieldNameHere!&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:55:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445690#M34905</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T19:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445691#M34906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In terms of style, &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;None&lt;/SPAN&gt; is a singleton so the idiomatic way to work with it is &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;var is None&lt;/SPAN&gt;.&amp;nbsp; For the Task1 field, I would go with:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;!MaintenanceTasks!&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;','&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; !MaintenanceTasks! &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; None&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For the Task2 field, I would try:&lt;/P&gt;&lt;PRE class="language-none"&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;!MaintenanceTasks!.split(',')[1] if !MaintenanceTasks! and ',' in !MaintenanceTasks! else None‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 19:07:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445691#M34906</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-10T19:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445692#M34907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;careful...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;n &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None

&lt;SPAN class="string token"&gt;","&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; n
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

&amp;nbsp; File &lt;SPAN class="string token"&gt;"&amp;lt;ipython-input-22-0746bac53200&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;","&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; n

TypeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; argument of type &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; iterable

&lt;SPAN class="comment token"&gt;# ---- BUT str, comes to the rescue&lt;/SPAN&gt;

 &lt;SPAN class="string token"&gt;","&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;n&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# --- amend the smokin' oneliner appropriately&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:55:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445692#M34907</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T19:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445693#M34908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To add to Dan's comment:&amp;nbsp; are you absolutely, 100% sure that the Maintenance Tasks values are comma separated? You may want to check for that. (Not that &lt;EM&gt;I've&lt;/EM&gt; ever been burned by something like that...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also notice that OID 17 has three elements.&amp;nbsp; Since you can't control how many elements you'll be presented (None through N), you may want to weave a len() method into your approach to determine how many elements you'll be extracting and which subsequent fields you'll be populating.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 19:36:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445693#M34908</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-01-10T19:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445694#M34909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;‌. This gets me to Task2. However, I have Task3, Task4, Task5, Task6 and Task7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 19:48:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445694#M34909</guid>
      <dc:creator>deleted-user-qpvAI3Fo0MKR</dc:creator>
      <dc:date>2019-01-10T19:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445695#M34910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joe, it is a comma - these are coming in from a list of check boxes in Survey123.&lt;/P&gt;&lt;P&gt;And you're right - I have up to 7 tasks in this field, so I'll need to look into the len() method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 19:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445695#M34910</guid>
      <dc:creator>deleted-user-qpvAI3Fo0MKR</dc:creator>
      <dc:date>2019-01-10T19:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445696#M34911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first part of the logical check prevents the TypeError:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; n &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; n &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;","&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; n
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; n &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'string'&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; n &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;","&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; n
&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; n &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'string,'&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; n &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;","&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; n
&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; 
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:55:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445696#M34911</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T19:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445697#M34912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to add to my earlier reply - I thing the .count(",")+1 method might be a better idea, no?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 19:54:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445697#M34912</guid>
      <dc:creator>deleted-user-qpvAI3Fo0MKR</dc:creator>
      <dc:date>2019-01-10T19:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445698#M34913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seeing you have several fields, it really is a job better suited for ArcPy and an update cursor rather than the Field Calculator.&amp;nbsp; That said, if you will only do this once and be done, then maybe a slightly clunky and manual way with the field calculator makes sense instead of learning how to script. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the following will work, just increment the numbers starting with 0 for each new field:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;!MaintenanceTasks!&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;','&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; !MaintenanceTasks! &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; !MaintenanceTasks!&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;count&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;','&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; None&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For example, Task1 will use 0, Task2 will use 1, Task3 will use 2, etc....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 20:10:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445698#M34913</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-10T20:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445699#M34914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm a list guy; gimme a list in python and I'll clean the plastic out of the oceans and get the furloughed fed works a pay check...&amp;nbsp; All seriousness aside:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;someList&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; do you thing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&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;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Personal preference is all....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I like Joshua's suggestion of the using a da.UpdateCursor too....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:55:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445699#M34914</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T19:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445700#M34915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe, have you seen &lt;A class="link-titled" href="https://nedbatchelder.com/text/iter.html" title="https://nedbatchelder.com/text/iter.html"&gt;Ned Batchelder: Loop Like A Native&lt;/A&gt; ?&amp;nbsp; I think you will find it worth the watch.&amp;nbsp; Ned does a good job of showing how certain common patterns in other languages, e.g., for i in range(len(someList)), can be rewritten to be much more Pythonic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 21:17:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445700#M34915</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-10T21:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445701#M34916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll check it out....&amp;nbsp; thanx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 21:22:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445701#M34916</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-01-10T21:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445702#M34917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;‌. This will happen monthly, so I'll likely use the DA module / update cursor.&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 21:49:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445702#M34917</guid>
      <dc:creator>deleted-user-qpvAI3Fo0MKR</dc:creator>
      <dc:date>2019-01-10T21:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445703#M34918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;enumerate...&lt;/P&gt;&lt;P&gt;try not to use …. range(len(something))&lt;/P&gt;&lt;P&gt;python linters will nail your code every time, and when you get used to it, it gives more and more possibilities.&lt;/P&gt;&lt;P&gt;good reading for the weekend Joe &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 22:11:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445703#M34918</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-10T22:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445704#M34919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;cool...&amp;nbsp; just tried it.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 22:32:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445704#M34919</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-01-10T22:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445705#M34920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you elaborate on this comment a bit, please? I'm pretty familiar with ArcPy, but this sounds more fundamental...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 22:49:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445705#M34920</guid>
      <dc:creator>deleted-user-qpvAI3Fo0MKR</dc:creator>
      <dc:date>2019-01-10T22:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445706#M34921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had to watch it a couple times, maybe a few, to grasp all of the points he was raising.&amp;nbsp; I watched it years ago, but it really did help me start to look at iterating/iterables/sequences in a different way than other languages.&amp;nbsp; Python is awesome.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 23:03:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445706#M34921</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-10T23:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445707#M34922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I won't steal any of Dan's thunder, but take a look here:&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="http://book.pythontips.com/en/latest/enumerate.html" title="http://book.pythontips.com/en/latest/enumerate.html"&gt;13. Enumerate — Python Tips 0.1 documentation&lt;/A&gt;&amp;nbsp;. It's an alternative to what I suggested.&amp;nbsp;&amp;nbsp;The link Joshua provides is very good as well!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 23:03:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445707#M34922</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-01-10T23:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting String at ',' accounting for No Data</title>
      <link>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445708#M34923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hate it when you forget to press Add Comment...&lt;/P&gt;&lt;P&gt;A bit late, but better than never&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Josh... a few enumerate things&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'a'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'c'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'b'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'d'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; j &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; enumerate&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{}, {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; j&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; a
&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c
&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b
&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; d

list&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;enumerate&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'a'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'c'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'b'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'d'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;



&lt;SPAN class="comment token"&gt;# ---- no need to check the length of something, enumerate is smart&lt;/SPAN&gt;


a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

list&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;enumerate&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;# ---- and they return the same thing, but 'enumerate' sounds cooler&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; enumerate&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;# ---- ps... they both returned nothing, but an empty list&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:55:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-string-at-accounting-for-no-data/m-p/445708#M34923</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T19:55:19Z</dc:date>
    </item>
  </channel>
</rss>

