<?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: Needing Help with a Python Statement. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/needing-help-with-a-python-statement/m-p/107292#M8289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Check out this post: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/50658-Iterate-with-leading-zeros"&gt;http://forums.arcgis.com/threads/50658-Iterate-with-leading-zeros&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The field calculator expresion equivalent should be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"str(!ORIG_MONTH!).zfill(2)"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Feb 2012 15:56:03 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2012-02-24T15:56:03Z</dc:date>
    <item>
      <title>Needing Help with a Python Statement.</title>
      <link>https://community.esri.com/t5/python-questions/needing-help-with-a-python-statement/m-p/107291#M8288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some data in ArcGIS that has a column in the attribute table for month. Right now it looks like 1, 2, 3, ... ,12. but I need it to look like 01, 02 , 03, ... , 12.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I figured the best way to do this, because i have a lot of data, would be to use calculate field and create a new field for month, with a python statement that would add a 0 to the front of any of the numbers with a length of one. I have yet to figure out a statment that would do this, I've tried many variations of !NewMonth! = '0' + !month!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is apprecaited.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 15:37:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/needing-help-with-a-python-statement/m-p/107291#M8288</guid>
      <dc:creator>AndrewRoberts2</dc:creator>
      <dc:date>2012-02-24T15:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Needing Help with a Python Statement.</title>
      <link>https://community.esri.com/t5/python-questions/needing-help-with-a-python-statement/m-p/107292#M8289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Check out this post: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/50658-Iterate-with-leading-zeros"&gt;http://forums.arcgis.com/threads/50658-Iterate-with-leading-zeros&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The field calculator expresion equivalent should be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"str(!ORIG_MONTH!).zfill(2)"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 15:56:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/needing-help-with-a-python-statement/m-p/107292#M8289</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-02-24T15:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Needing Help with a Python Statement.</title>
      <link>https://community.esri.com/t5/python-questions/needing-help-with-a-python-statement/m-p/107293#M8290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is how I got this to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]15759[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 11:21:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/needing-help-with-a-python-statement/m-p/107293#M8290</guid>
      <dc:creator>AndrewRoberts2</dc:creator>
      <dc:date>2012-07-04T11:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Needing Help with a Python Statement.</title>
      <link>https://community.esri.com/t5/python-questions/needing-help-with-a-python-statement/m-p/107294#M8291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Another way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
r"%i/%02i" % (year, month)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:30:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/needing-help-with-a-python-statement/m-p/107294#M8291</guid>
      <dc:creator>FabianBlau</dc:creator>
      <dc:date>2021-12-11T06:30:18Z</dc:date>
    </item>
  </channel>
</rss>

