<?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: Assign Field values via Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/assign-field-values-via-python/m-p/258974#M19924</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Greetings,&lt;BR /&gt;&lt;BR /&gt;I am attempting to calculate point stationing (footage) along a pipeline at a set interval via python script,&amp;nbsp; thing is I'm just now learning to code in Python, I come from a VBA programming background.&amp;nbsp; In regards to this exercise I will be creating an empty file geodatabase, within this database I will be creating an empty feature class table.&amp;nbsp; This feature class table will contain an empty field/column named, "Calculated Footage".&amp;nbsp; My desired result is to populate the content of my feature clas table via Python script such as the ones below.&lt;BR /&gt;&lt;BR /&gt;I have been successful in obtaining the desired results within a python list as shown below but when attempting to do so in a file geodatabase I seem to be at a lost. Simply put how do I go about applying the logic below to the "Calculated Footage" field in my feature class table? In other words how do I populate the "Calculated Footage" field with the result of my while loop?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;B_Measure = 0; E_Measure = 5280
Curr_Measure = 0; Interval = 1000
My_List=[]

C_Measure = 0

# Body of the Main program
while abs(E_Measure-C_Measure)&amp;gt;Interval:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if My_List==[]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; My_List.append(C_Measure)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print C_Measure
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C_Measure=C_Measure + Interval
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; My_List.append(C_Measure)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print C_Measure&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I've done this exercise in Excel as well, using the following VBA Code.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Sub Calculate_Footage()
'Declaring variables
Dim X, Y, Beginning_Point, Ending_Point, Interval, Current_Point As Integer

'Assigning initial value to variables
X = 2
Y = 1
Beginning_Point = 0
Ending_Point = 5280
Interval = 1000
Current_Point = 0

'Assign Field/Column Name
Cells(1, 1).Value = "Calculated Footage"

'This While Loop will populate my "Calculated Footage" field
Do While (Ending_Point - Current_Point) &amp;gt; Interval
Current_Point = Current_Point + Interval
Cells(X, Y).Value = Current_Point

'Move to the next row but same column
X = X + 1
Loop

End Sub
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I use the Calculate Field function to iterate through the subject field or should I somehow use the List.append method to add values and iterate through the subject field?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 12:45:00 GMT</pubDate>
    <dc:creator>RoyMartinez1</dc:creator>
    <dc:date>2021-12-11T12:45:00Z</dc:date>
    <item>
      <title>Assign Field values via Python</title>
      <link>https://community.esri.com/t5/python-questions/assign-field-values-via-python/m-p/258973#M19923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am attempting to calculate point stationing (footage) along a pipeline at a set interval via python script.&amp;nbsp; Thing is I'm just now learning to code in Python, I have a VBA programming background.&amp;nbsp; In regards to this exercise I will be creating an empty file geodatabase, within this database I will be creating an empty feature class.&amp;nbsp; This feature class will contain an empty field/column named, "Calculated Footage".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been successful in obtaining the desired results within a python list as shown below but when attempting to do so in a file geodatabase I seem to be at a lost. Simply put how do I go about applying the logic below to the "Calculated Footage" field in my feature class table? In other words how do I populate the "Calculated Footage" field with the result of my while loop?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;B_Measure = 0; E_Measure = 5280
Curr_Measure = 0; Interval = 1000
My_List=[]

C_Measure = 0

# Body of the Main program
while abs(E_Measure-C_Measure)&amp;gt;Interval:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if My_List==[]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; My_List.append(C_Measure)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print C_Measure
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C_Measure=C_Measure + Interval
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; My_List.append(C_Measure)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print C_Measure&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I've done this exercise in Excel as well, using the following VBA Code.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Sub Calculate_Footage()
'Declaring variables
Dim X, Y, Beginning_Point, Ending_Point, Interval, Current_Point As Integer

'Assigning initial value to variables
X = 2
Y = 1
Beginning_Point = 0
Ending_Point = 5280
Interval = 1000
Current_Point = 0

'Assign Field/Column Name
Cells(1, 1).Value = "Calculated Footage"

'This While Loop will populate my "Calculated Footage" field
Do While (Ending_Point - Current_Point) &amp;gt; Interval
Current_Point = Current_Point + Interval
Cells(X, Y).Value = Current_Point

'Move to the next row but same column
X = X + 1
Loop

End Sub
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Oct 2012 05:57:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/assign-field-values-via-python/m-p/258973#M19923</guid>
      <dc:creator>RoyMartinez1</dc:creator>
      <dc:date>2012-10-28T05:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Assign Field values via Python</title>
      <link>https://community.esri.com/t5/python-questions/assign-field-values-via-python/m-p/258974#M19924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Greetings,&lt;BR /&gt;&lt;BR /&gt;I am attempting to calculate point stationing (footage) along a pipeline at a set interval via python script,&amp;nbsp; thing is I'm just now learning to code in Python, I come from a VBA programming background.&amp;nbsp; In regards to this exercise I will be creating an empty file geodatabase, within this database I will be creating an empty feature class table.&amp;nbsp; This feature class table will contain an empty field/column named, "Calculated Footage".&amp;nbsp; My desired result is to populate the content of my feature clas table via Python script such as the ones below.&lt;BR /&gt;&lt;BR /&gt;I have been successful in obtaining the desired results within a python list as shown below but when attempting to do so in a file geodatabase I seem to be at a lost. Simply put how do I go about applying the logic below to the "Calculated Footage" field in my feature class table? In other words how do I populate the "Calculated Footage" field with the result of my while loop?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;B_Measure = 0; E_Measure = 5280
Curr_Measure = 0; Interval = 1000
My_List=[]

C_Measure = 0

# Body of the Main program
while abs(E_Measure-C_Measure)&amp;gt;Interval:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if My_List==[]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; My_List.append(C_Measure)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print C_Measure
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C_Measure=C_Measure + Interval
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; My_List.append(C_Measure)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print C_Measure&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I've done this exercise in Excel as well, using the following VBA Code.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Sub Calculate_Footage()
'Declaring variables
Dim X, Y, Beginning_Point, Ending_Point, Interval, Current_Point As Integer

'Assigning initial value to variables
X = 2
Y = 1
Beginning_Point = 0
Ending_Point = 5280
Interval = 1000
Current_Point = 0

'Assign Field/Column Name
Cells(1, 1).Value = "Calculated Footage"

'This While Loop will populate my "Calculated Footage" field
Do While (Ending_Point - Current_Point) &amp;gt; Interval
Current_Point = Current_Point + Interval
Cells(X, Y).Value = Current_Point

'Move to the next row but same column
X = X + 1
Loop

End Sub
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I use the Calculate Field function to iterate through the subject field or should I somehow use the List.append method to add values and iterate through the subject field?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:45:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/assign-field-values-via-python/m-p/258974#M19924</guid>
      <dc:creator>RoyMartinez1</dc:creator>
      <dc:date>2021-12-11T12:45:00Z</dc:date>
    </item>
  </channel>
</rss>

