<?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: How do I use the minimum and maximum values from a single column in python or VBscript? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255720#M19651</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It recognized the table and fields, but then I got the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; normalizeField('LSBC_PHID',"VAL","NORM")&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Runtime error &amp;lt;type 'exceptions.AttributeError'&amp;gt;: 'module' object has no attribute 'da'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I imported Arcpy....forgot that as step 1....and then tried again. I then received this error:&lt;/P&gt;&lt;P&gt;Parsing error &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: EOL while scanning string literal (line 1). I was missing a " before on of the field names...tried it again and received the error above again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to set the variables so In_table = "c:\etc...." location of the table and then in_field="VAL", and out_field="NORM"&lt;/P&gt;&lt;P&gt;I also had to reverse the directions of all slash bars because Modelbuilder uses "/" and Windows Explorer uses "\".&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After all this I was able to run the first code but I then received this error:&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; normalizeField(in_table,in_field,out_field)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Runtime error &amp;lt;type 'exceptions.RuntimeError'&amp;gt;: ERROR 999999: Error executing function.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;An invalid SQL statement was used.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;An invalid SQL statement was used. [LSBC_PHID]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;An invalid SQL statement was used. [SELECT * FROM LSBC_PHID WHERE ( VALTEST )]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought VAL may be a reserved word in arcpy or python so I changed the field name to "VALTEST" and I still got this error. LSBC_PHID is the name of the feature class with the table Ii'm using. Do I need to export it as a separate table? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running ArcMAP 10.0 with service pack 5 Build 4400. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Sep 2014 20:35:12 GMT</pubDate>
    <dc:creator>DanielAmrine</dc:creator>
    <dc:date>2014-09-23T20:35:12Z</dc:date>
    <item>
      <title>How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255711#M19642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GEONET,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;Essentially i want to normalize the Value field (VAL) in a series of point layers using an expression in python or VBscript. I have spent all morning browsing "The Web" for examples and all i can find are long expressions using the code block and that involves building a list of the values and selecting the highest or lowest. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;The equation is (x-min(x))/(max(x)-min(x))....&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;In the python expression I tried FieldB = (!VAL! - min([!VAL!]))/(max([!VAL!])-min([!VAL!])) this returned &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;ERROR 000539: Error Running expression:(38.891808-min([&lt;SPAN style="font-size: 16px;"&gt;38.891808]))/(max([&lt;SPAN style="font-size: 16px;"&gt;38.891808]) etc...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN style="font-size: 16px;"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;It's reading the value from the field rather than the actual minimum which is 3.285462 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;I also tried FieldB = min([!VAL!]) and it returned the values for each record rather than actual minimum value in each record. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;I would really love to have the ability to run a single expression on each of these layers rather than summarizing each individual table and then plugging the values in by hand. This requires going through each layer individually and this will be extremely time consuming and it seems like there should be a smarter way.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Any help on this is much appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px;"&gt;Dan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 14:33:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255711#M19642</guid>
      <dc:creator>DanielAmrine</dc:creator>
      <dc:date>2014-09-23T14:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255712#M19643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use several methods, the easiest one would be to use Summary Statistics Tool (Analysis Tools Toolbox -&amp;gt; Statistics -&amp;gt; Summary Statistics).&amp;nbsp; The other option would be to use the dissolve tool (Data Management Tools -&amp;gt; Generalization -&amp;gt; Dissolve -&amp;gt; Pick your summary stats).&amp;nbsp; To use the dissolve, you will need a uniform field to use as a dissolve value, ex. DISSOLVE_ID, every row equals 1 or 0 or something.&amp;nbsp; Use that column to dissolve on, then choose your summary stats pointed to the field you want the min/max values for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 14:51:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255712#M19643</guid>
      <dc:creator>IanGrasshoff</dc:creator>
      <dc:date>2014-09-23T14:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255713#M19644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you search for a python solution, have a look here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://arcpy.wordpress.com/2012/02/01/calculate-a-mean-value-from-a-field/" title="http://arcpy.wordpress.com/2012/02/01/calculate-a-mean-value-from-a-field/"&gt;Calculate a mean value from a field | ArcPy Café&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 14:55:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255713#M19644</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2014-09-23T14:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255714#M19645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is definitely a way to address this without resorting to plugging values in by hand.&amp;nbsp; That being said, it isn't going to be a simple expression in Field Calculator that does it.&amp;nbsp; Do you have a requirement to use Field Calculator?&amp;nbsp; If so, I think "The Web" has already given you the answer(s).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The behavior you are seeing, at least the parts that aren't errors, are expected.&amp;nbsp; Field Calculator operates like a cursor, at least logically.&amp;nbsp; Field Calculator only sees one record at a time, even if it is operating over an entire set of records.&amp;nbsp; The Codeblock section allows for a little bit of kung fu but we are talking Kung Fu Panda and not Caine.&amp;nbsp; This is why your min and max functions are returning VAL instead of the min and max for the field.&amp;nbsp; If you were looking at minimum or maximum values across fields for a given record, then the approach might work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As &lt;A href="https://community.esri.com/migrated-users/10224"&gt;Ian Grasshoff&lt;/A&gt;‌ mentions, you could use the Summary Statistics tool.&amp;nbsp; My rub with that tool, and why I seldom use it, is that it creates a table to place the values.&amp;nbsp; The last thing I want is another table to extract values from and have to clean up afterwards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As &lt;A href="https://community.esri.com/migrated-users/47947"&gt;Johannes Bierer&lt;/A&gt;‌ links to, you could use arcpy.da.TableToNumPyArrary to dump the table and find the minimum, maximum, or other statistics that way.&amp;nbsp; My only concern with that approach, well all approaches involving lists, is that creating the lists can consume lots of memory depending on the data sets involved.&amp;nbsp; Why create a list with a million elements if you only want to know the minimum and maximum values for the field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example of a function you could create and then call from the Python interactive window:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14114972558114414 jive_text_macro" jivemacro_uid="_14114972558114414"&gt;
&lt;P&gt;def normalizeField(in_table, in_field, out_field):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(in_table, in_field) as cur:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x, = next(iter(cur))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minimum = maximum = x&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for x, in cur:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x &amp;lt; minimum:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minimum = x&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x &amp;gt; maximum:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maximum = x&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor(in_table, [in_field, out_field]) as cur:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for x, y in cur:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = (float(x) - minimum)/(maximum - minimum)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur.updateRow([x,y])&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The float with the UpdateCursor ensures the normalization value doesn't truncate to an integer if the in_field happens to be an integer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 18:35:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255714#M19645</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-09-23T18:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255715#M19646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for this great answer, and thank you Ian and Johannes as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created this model as a workaround but it is cumbersome and has to be "Reset" each time.&lt;IMG __jive_id="14828" alt="SummaryJoin.jpg" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/14828_SummaryJoin.jpg" style="width: 620px; height: 358px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also had to remove the natural neighbor because every time i tried to run the model it said the "Z value" field was missing even though i double checked the input and the field was there populated with the correct values. Not sure why this happened.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I copied your code into the Python Window, but when i call function I'm not clear on how to add the table, in field, and outfield. This is the results i'm getting. I understand the concept of the code but I'm missing the correct syntax.&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; normalizeField('MSBNC_PHIN',!VAL!,!NORM!)&lt;/P&gt;&lt;P&gt;Parsing error &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: invalid syntax (line 1)&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; normalizeField('MSBNC_PHIN',[!VAL!],[!NORM!])&lt;/P&gt;&lt;P&gt;Parsing error &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: invalid syntax (line 1)&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; normalizeField('MSBNC_PHIN',(!VAL!),(!NORM!))&lt;/P&gt;&lt;P&gt;Parsing error &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: invalid syntax (line 1)&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; normalizeField&lt;/P&gt;&lt;P&gt;&amp;lt;function normalizeField at 0x1E98BFB0&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; normalizeField('MSBNC_PHIN',[!VAL!,!NORM!])&lt;/P&gt;&lt;P&gt;Parsing error &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: invalid syntax (line 1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Again!&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 19:06:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255715#M19646</guid>
      <dc:creator>DanielAmrine</dc:creator>
      <dc:date>2014-09-23T19:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255716#M19647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice example &lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;, but maybe to make it a little shorter you can determine the min and max as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14114995480507431" jivemacro_uid="_14114995480507431"&gt;
&lt;P&gt;def normalizeField(in_table, in_field, out_field):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst = [r[0] for r in arcpy.da.SearchCursor(in_table, (in_field))]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; minimum = min(lst)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maximum = max(lst)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # ect&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure how this affects performance though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 19:12:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255716#M19647</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-09-23T19:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255717#M19648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌, I agree the list-based example you provide is more succinct, not to mention will also work.&amp;nbsp; The reason I went with a slightly more verbose iterator than a more succinct list comprehension was memory management.&amp;nbsp; If one happens to be dealing with millions, tens of millions, or even more records, fully populating a list will impact memory and probably performance.&amp;nbsp; That said, most users likely never deal with data sets large enough to see memory or performance differences between the two approaches..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 19:23:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255717#M19648</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-09-23T19:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255718#M19649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I roughed out the example to run from the interactive Python window.&amp;nbsp; I don't work with Model Builder much or at all, so I can't help much in terms of incorporating it into that workflow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function takes strings for all arguments.&amp;nbsp; If VAL is the name of the field, use "VAL" with just quotes and no brackets or parentheses, same with NORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 19:38:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255718#M19649</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-09-23T19:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255719#M19650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are absolutely right. Memory considerations should be taken into account.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 19:42:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255719#M19650</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-09-23T19:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255720#M19651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It recognized the table and fields, but then I got the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; normalizeField('LSBC_PHID',"VAL","NORM")&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Runtime error &amp;lt;type 'exceptions.AttributeError'&amp;gt;: 'module' object has no attribute 'da'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I imported Arcpy....forgot that as step 1....and then tried again. I then received this error:&lt;/P&gt;&lt;P&gt;Parsing error &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: EOL while scanning string literal (line 1). I was missing a " before on of the field names...tried it again and received the error above again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to set the variables so In_table = "c:\etc...." location of the table and then in_field="VAL", and out_field="NORM"&lt;/P&gt;&lt;P&gt;I also had to reverse the directions of all slash bars because Modelbuilder uses "/" and Windows Explorer uses "\".&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After all this I was able to run the first code but I then received this error:&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; normalizeField(in_table,in_field,out_field)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Runtime error &amp;lt;type 'exceptions.RuntimeError'&amp;gt;: ERROR 999999: Error executing function.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;An invalid SQL statement was used.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;An invalid SQL statement was used. [LSBC_PHID]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;An invalid SQL statement was used. [SELECT * FROM LSBC_PHID WHERE ( VALTEST )]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought VAL may be a reserved word in arcpy or python so I changed the field name to "VALTEST" and I still got this error. LSBC_PHID is the name of the feature class with the table Ii'm using. Do I need to export it as a separate table? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am running ArcMAP 10.0 with service pack 5 Build 4400. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 20:35:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255720#M19651</guid>
      <dc:creator>DanielAmrine</dc:creator>
      <dc:date>2014-09-23T20:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255721#M19652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data access module (da) was introduced at 10.1...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 20:38:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255721#M19652</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-09-23T20:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255722#M19653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haven't tested it, but this might work in 10.0 SP5:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14115056049645120 jive_text_macro" jivemacro_uid="_14115056049645120" modifiedtitle="true"&gt;
&lt;P&gt;def normalizeField(in_table, in_field, out_field):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst = [r.getValue(in_field) for r in arcpy.SearchCursor(in_table)]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; minimum = min(lst)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maximum = max(lst)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.UpdateCursor(in_table) as cur:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cur:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue(out_field, (float(row.&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;getValue(in_field)&lt;/SPAN&gt;) - minimum)/(maximum - minimum))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur.updateRow(row)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 20:53:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255722#M19653</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-09-23T20:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255723#M19654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't believe the original cursors (non da cursors) supported the Python with statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Original code example modified for original cursors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14115059819151086" jivemacro_uid="_14115059819151086"&gt;
&lt;P&gt;def normalizeField_10(in_table, in_field, out_field): &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur = arcpy.SearchCursor(in_table)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = next(iter(cur))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; minimum = maximum = row.getValue(in_field)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cur:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = row.getValue(in_field)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x &amp;lt; minimum: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minimum = x &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if x &amp;gt; maximum: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maximum = x&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; del cur&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur = arcpy.UpdateCursor(in_table)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cur:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue(out_field, (float(row.getValue(in_field)) - minimum)/(maximum - minimum))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur.updateRow(row)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; del cur&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 20:59:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255723#M19654</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-09-23T20:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255724#M19655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;True! The with statement does not work for the old cursors, but the list comprehension can be used to determine the min and max...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 21:17:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255724#M19655</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-09-23T21:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255725#M19656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander and Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate the code, and it kind of worked without the ".da."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I'm having difficulty setting the variable for in_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm trying to access the table of a feature class in a geodatabase.&amp;nbsp; &lt;/P&gt;&lt;P&gt;in_table = "C:/Users/damrine/Desktop/DATA/EARTHFIELD/rockymountian/Wattenburg/DATA/Wattenburg_Earthfield_Database.gdb/LSBC_PHID" i also tried setting the active workspace and using arcpy to select the table but it gave the same error below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After I execute the function I gives me this:&lt;/P&gt;&lt;P&gt;Runtime error &amp;lt;type 'exceptions.AttributeError'&amp;gt;: 'Cursor' object has no attribute '__exit__'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does this for both the list function and Joshua's function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm at a loss and this thread really highlights how tedious python can be because once you spend the time to write the code like you guys did, you have to spend an equal or greater amount of time troubleshooting it until it works on the current data set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean if you put everything into a nice little geodatabase on the c: drive and keep it tiny it works fine, but when you're working on a company network with lots of different layers and data types the troubleshooting becomes too cumbersome and it ends up taking too much time to be useful. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Forgive me for my little rant, I really do appreciate your work on this.&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 15:32:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255725#M19656</guid>
      <dc:creator>DanielAmrine</dc:creator>
      <dc:date>2014-09-24T15:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255726#M19657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you post the code you are using? It seems something is not right with the import statement(s). The def does not include any import of arcpy, if arcpy is not imported globally it will not be available inside the def...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 16:12:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255726#M19657</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-09-24T16:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255727#M19658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using my second code snippet?&amp;nbsp; The error message you are getting is likely caused by using a Python "with" statement and the older cursors.&amp;nbsp; The second code snippet I posted most recently does not use the with statement and should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your issue with working over the network has nothing to do with Python.&amp;nbsp; I would argue ArcGIS Desktop has historically handled network-based data, like UNC paths, very poorly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the second code snippet I posted will work, and with any data set.&amp;nbsp; To defend scripting with Python, it is way more powerful than most of the GUI tools, which one would expect.&amp;nbsp; And, GUI tools don't always work as well, and I find troubleshooting them much more frustrating than Python.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 16:13:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255727#M19658</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-09-24T16:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255728#M19659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New'; color: #303030;"&gt;Joshua,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New'; color: #303030;"&gt;I used your second snippet, entered into the python window. Below is the pasted snippet, however i can't seem to find an option to "code wrap it" in the geonet editor. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;def&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; normalizeField_10(in_table, in_field, out_field):&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... cur = arcpy.SearchCursor(in_table) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... row = next(iter(cur))&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... minimum = maximum = row.getValue(in_field)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; row &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; cur:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = row.getValue(in_field)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; x &amp;lt; minimum:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minimum = x&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; x &amp;gt; maximum:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maximum = x&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;del&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; cur&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... cur = arcpy.UpdateCursor(in_table) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; row &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; cur:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue(out_field, (float(row.getValue(in_field)) - minimum)/(maximum - minimum))&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur.updateRow(row)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;del&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; cur &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;This is how I defined the variables and imported the arcpy.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;gt;&amp;gt;&amp;gt; in_table = "C:\Users\damrine\Desktop\DATA\EARTHFIELD\rockymountian\Wattenburg\DATA\Wattenburg_Earthfield_Database.gdb\LSBC_PHID"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;gt;&amp;gt;&amp;gt; in_field = "VAL"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;gt;&amp;gt;&amp;gt; out_field = "NORM"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;I am trying to run this on the feature class point table located in the in_table string.I also tried setting the environment to current MXD and data frame but I couldn't get that to work either.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;I didn't want to start a debate, it's a personal frustration of mine because I don't have the time to devote to learning Python. It's like learning a new language you have to practice a lot to really use it well. If you can't devote a few hours a week at least you will never learn it. The GUI and model builder are not as powerful but the learning curve is not nearly as steep. I know the problems I'm having stems from the fact that I don't know what a "Cursor" means or how that applies to the map document, It's probably really simple but not knowing this first step makes it difficult to apply these code snippets. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12pt;"&gt;You helped me with the code and now it is my challenge to find out how to set it up in the correct way to run. I'm &lt;SPAN style="line-height: 24px;"&gt;definitely&lt;/SPAN&gt; not discouraging you from helping but you provided the code and just seeing it really helps me to understand how python can be applied to calculate a normalized data set. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;Thank You,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;Dan&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; margin-bottom: .0001pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 14:24:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255728#M19659</guid>
      <dc:creator>DanielAmrine</dc:creator>
      <dc:date>2014-09-25T14:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the minimum and maximum values from a single column in python or VBscript?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255729#M19660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Daniel, to code wrap you need to use the 'advanced editor' option in the upper right corner.&amp;nbsp; Once in the advanced editor, you can do syntax highlighting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to clarify, the code you just posted is generating the cursor object error you mention earlier?&amp;nbsp; Can you try running the command and pasting the exact error messages that are returned, all of them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One potential problem I see, although it wouldn't generate the cursor object error, is your string representing the feature class.&amp;nbsp; If you are going to use Windows-style paths (single backslashes for directories), you should put in 'r' in front of the first quote to signify a raw string.&amp;nbsp; For example, r"C:\Users\damrine" instead of "C:\Users\damrine".&amp;nbsp; In Python, a backslash is an escape character, which can create problems with Windows-style paths if people don't realize that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 14:41:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-use-the-minimum-and-maximum-values-from-a/m-p/255729#M19660</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-09-25T14:41:00Z</dc:date>
    </item>
  </channel>
</rss>

