MCPcopy Index your code
hub / github.com/numpy/numpy / identity

Method identity

numpy/polynomial/_polybase.py:1080–1112  ·  view source on GitHub ↗

Identity function. If ``p`` is the returned series, then ``p(x) == x`` for all values of x. Parameters ---------- domain : {None, array_like}, optional If given, the array must be of the form ``[beg, end]``, where ``beg`` and ``end``

(cls, domain=None, window=None, symbol='x')

Source from the content-addressed store, hash-verified

1078
1079 @classmethod
1080 def identity(cls, domain=None, window=None, symbol='x'):
1081 """Identity function.
1082
1083 If ``p`` is the returned series, then ``p(x) == x`` for all
1084 values of x.
1085
1086 Parameters
1087 ----------
1088 domain : {None, array_like}, optional
1089 If given, the array must be of the form ``[beg, end]``, where
1090 ``beg`` and ``end`` are the endpoints of the domain. If None is
1091 given then the class domain is used. The default is None.
1092 window : {None, array_like}, optional
1093 If given, the resulting array must be if the form
1094 ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of
1095 the window. If None is given then the class window is used. The
1096 default is None.
1097 symbol : str, optional
1098 Symbol representing the independent variable. Default is 'x'.
1099
1100 Returns
1101 -------
1102 new_series : series
1103 Series of representing the identity.
1104
1105 """
1106 if domain is None:
1107 domain = cls.domain
1108 if window is None:
1109 window = cls.window
1110 off, scl = pu.mapparms(window, domain)
1111 coef = cls._line(off, scl)
1112 return cls(coef, domain, window, symbol)
1113
1114 @classmethod
1115 def basis(cls, deg, domain=None, window=None, symbol='x'):

Callers 11

test_basicMethod · 0.80
test_kron_maMethod · 0.80
check_qr_stackedMethod · 0.80
test_identityFunction · 0.80
test_identityMethod · 0.80
convertMethod · 0.80
test_identityFunction · 0.80
test_identityFunction · 0.80
time_identity_100Method · 0.80
time_identity_3000Method · 0.80

Calls 2

mapparmsMethod · 0.80
_lineMethod · 0.80

Tested by 7

test_basicMethod · 0.64
test_kron_maMethod · 0.64
check_qr_stackedMethod · 0.64
test_identityFunction · 0.64
test_identityMethod · 0.64
test_identityFunction · 0.64
test_identityFunction · 0.64