<?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: convert row values to field values in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738465#M57136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sorry I forgot to mention I am using ArcGIS 9.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are code block or transpose field still available iin 9.3?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jun 2012 21:08:09 GMT</pubDate>
    <dc:creator>ElaineKuo</dc:creator>
    <dc:date>2012-06-13T21:08:09Z</dc:date>
    <item>
      <title>convert row values to field values</title>
      <link>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738462#M57133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a table describing annual temperature of seasonal distributions of five birds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now the fields of the table are as followed:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rowid, bird_code (classified as summer and winter), min, max, mean&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I want to convert the row values of summer (in bird_code) into a new field, with the row of min, max, and mean.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please kindly advise any python code to perform this task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 20:45:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738462#M57133</guid>
      <dc:creator>ElaineKuo</dc:creator>
      <dc:date>2012-06-12T20:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: convert row values to field values</title>
      <link>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738463#M57134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use Calculate Field tool (under Data Management &amp;gt; Fields). The screenshot below shows an example. Here, in the expression I'm passing four field values to a function. The function is implemented in code block.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know what you want to do with the three values (min, max, mean). Here, I have just converted them to string and concatanated before returning (if the bird code is summer).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]15164[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 06:32:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738463#M57134</guid>
      <dc:creator>NobbirAhmed</dc:creator>
      <dc:date>2012-06-13T06:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: convert row values to field values</title>
      <link>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738464#M57135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can try the Transpose Fields tool:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0017000000v4000000" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0017000000v4000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 14:40:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738464#M57135</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2012-06-13T14:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: convert row values to field values</title>
      <link>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738465#M57136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sorry I forgot to mention I am using ArcGIS 9.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are code block or transpose field still available iin 9.3?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 21:08:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738465#M57136</guid>
      <dc:creator>ElaineKuo</dc:creator>
      <dc:date>2012-06-13T21:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: convert row values to field values</title>
      <link>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738466#M57137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Calculate Field is available on 9.3 and the code should work on 9.3 as well. Are you getting any error? Here is the doc for that version of ArcGIS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Calculate_Field_(Data_Management"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Calculate_Field_(Data_Management&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2012 21:11:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738466#M57137</guid>
      <dc:creator>NobbirAhmed</dc:creator>
      <dc:date>2012-06-13T21:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: convert row values to field values</title>
      <link>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738467#M57138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;sorry for the late response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The above link is broken.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, please kindly advise how to write the expression in the following code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;##Script Name: Make a line from points
##Description: Connect the line by points using XToools Pro
##Created By: Elaine Kuo
##Date: 03/05/2012


#Import standard library modules
import arcgisscripting
import os

#Create the Geoprocessor object
gp = arcgisscripting.create(9.3)

#Set the input workspace
#GP.workspace = sys.argv[1]
#Set the workspace.
gp.Workspace= "H:/temp/test"

#Set the output workspace
#outWorkspace = sys.argv[2]
#Set the workspace. List all of the feature classes in the dataset
outWorkspace= "H:/temp"



#Get a list of the featureclasses in the input folder
fcs = gp.ListFeatureClasses()

# Loop through every item in the list that was just generated
for fc in fcs:

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Break out the name, no path or extension, using the describe object.
&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = gp.describe(fc)
&amp;nbsp;&amp;nbsp;&amp;nbsp; featureName = desc.name

&amp;nbsp;&amp;nbsp;&amp;nbsp; #Validate the new feature class name for the output workspace.
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Toolbox = "Data Management"

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Add a field to this shapefile
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addfield (fc, "min", "double", 6,3)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Loop through every item in the list that was just generated 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.toolbox = "Data Management"


&amp;nbsp;&amp;nbsp;&amp;nbsp; expression = "!min!"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CalculateField_management(fc, "min", expression, "PYTHON")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Validate the new feature class name for the output workspace.
&amp;nbsp;&amp;nbsp;&amp;nbsp; OutFeatureClass = outWorkspace + os.sep + gp.ValidateTableName(fc,outWorkspace)

gp.AddMessage(gp.GetMessages())
print gp.GetMessages()

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:26:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-row-values-to-field-values/m-p/738467#M57138</guid>
      <dc:creator>ElaineKuo</dc:creator>
      <dc:date>2021-12-12T07:26:44Z</dc:date>
    </item>
  </channel>
</rss>

