I need to find maximum value among hundreds of variables. For example, I have 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 0, 10, 20, etc and I would like to write a code like max(2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 0, 10, 20) and get the maximu value. I tried, somehow it did not work.
I found a max function in ArcGIS help as max([!field1!, !field2!, !field3!])
max(2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 0, 10, 20) and get the maximu value. I tried, somehow it did not work.
Yes, it should work. there are two valid syntaxes:
>>> max(3,2,1,5)
5
>>> max([3,2,1,5])
5
I found a max function in ArcGIS help as max([!field1!, !field2!, !field3!])
what does ! mean?
This is the python max function (second syntax), used inside the Calculate Field tool (which uses a "!" delimeter to substitute field names in to Python expressions).