ArcGIS字段计算器中的python函数

字段计算器界面如图

 

.conjugate(),共轭复数

.denominator(),返回分母

.imag(),返回复数的虚数部分

.numerator(),返回分子

.real(),返回复数的实数部分

.as_interger_ratio():

Return a pair of integers whose ratio is exactly equal to the original float and with a positive denominator. RaisesOverflowError
on infinities and aValueError
on NaNs.

 

.fromhex():

Class method to return the float represented by a hexadecimal string s. The strings may have leading and trailing whitespace.

.hex():

Return a representation of a floating-point number as a hexadecimal string. For finite floating-point numbers, this representation will always include a leading0x and a trailing
p and exponent.

 

.is_integer():Return True if the float instance is finite with integral value, andFalse otherwise:

math.acos():反余弦(弧度)

math.acosh():反双曲余弦

math.asin():反正弦

math.asinh():反双曲正弦

math.atan():反正切

math.atan2():

Return atan(y/x), in radians. The result is between-pi andpi.
The vector in the plane from the origin to point(x,y) makes this angle with the positive X axis. The point ofatan2()
is that the signs of both inputs are known to it, so it can compute the correct quadrant for the angle. For example,atan(1) andatan2(1,
1)
are both pi/4, butatan2(-1,-1) is-3*pi/4.

 

math.atanh():反双曲正切

math.ceil():

Return the ceiling of x as a float, the smallest integer value greater than or equal tox

math.copysign():Return x with the sign of y. On a platform that supports signed zeros,copysign(1.0,-0.0) returns
-1.0.

 

math.cos():余弦

math.cosh():双曲余弦

math.degrees():转弧度为度

math.e():e

math.exp():e的指数次方

math.fabs():绝对值

math.factorial():

Return x factorial. Raises
ValueError
ifx is not integral or is negative,(阶乘)

 

math.floor():

Return the floor of x as a float, the largest integer value less than or equal tox.(小于等于x的最大整数)

 

math.fmod():

Return fmod(x,y), as defined by the platform C library. Note that the Python expressionx%y
may not return the same result. The intent of the C standard is thatfmod(x,y) be exactly (mathematically; to infinite precision) equal tox-n*y
for some integer n such that the result has the same sign asx and magnitude less thanabs(y). Python’sx%y
returns a result with the sign ofy instead, and may not be exactly computable for float arguments. For example,fmod(-1e-100,1e100) is
-1e-100, but the result of Python’s-1e-100%1e100 is
1e100-1e-100, which cannot be represented exactly as a float, and rounds to the surprising1e100. For this reason, functionfmod()
is generally preferred when working with floats, while Python’sx%y is preferred when working with integers.

 

matn.frexp():

Return the mantissa and exponent of x as the pair
(m, e)
. m is a float ande is an integer such thatx==m
*2**e
exactly. Ifx is zero, returns
(0.0,0), otherwise
0.5<=
abs(m)<1
. This is used to “pick apart” the internal representation of a float in a portable way.

 

math.fsum():

Return an accurate floating point sum of values in the iterable. Avoids loss of precision by tracking multiple intermediate partial sums:

 

math.htpot():

Return the Euclidean norm, sqrt(x*x+y*y). This is the length of the vector from the origin to point(x,y).

 

math.isinf():Check if the float x is positive or negative infinity

math.isnan():Check if the float x is a NaN (not a number). For more information on NaNs, see the IEEE 754 standards

math.ldexp():Return x
* (2**i)
. This is essentially the inverse of functionfrexp()

math.log():以e为底的对数

math.log10():以10为底对数

math.log1p():Return the natural logarithm of 1+x (base
e). The result is calculated in a way which is accurate forx near zero

math.modf():Return the fractional and integer parts of x. Both results carry the sign ofx and are floats.

 

math.pi():π

math.pow():x的y次幂

math.radians():转度为弧度

math.sin():正弦

math.sinh():双曲正弦

math.sqrt():平方根

math.tan():正切

math.tanh():双曲正切

matn.trunc():Return the
Real
valuex truncated to anIntegral (usually a long integer). Uses the__trunc__ method

 

转载自:https://blog.csdn.net/sxzhustar/article/details/12014253

You may also like...