MCPcopy Create free account
hub / github.com/numpy/numpy / identity

Method identity

numpy/polynomial/_polybase.py:1091–1123  ·  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

1089
1090 @classmethod
1091 def identity(cls, domain=None, window=None, symbol='x'):
1092 """Identity function.
1093
1094 If ``p`` is the returned series, then ``p(x) == x`` for all
1095 values of x.
1096
1097 Parameters
1098 ----------
1099 domain : {None, array_like}, optional
1100 If given, the array must be of the form ``[beg, end]``, where
1101 ``beg`` and ``end`` are the endpoints of the domain. If None is
1102 given then the class domain is used. The default is None.
1103 window : {None, array_like}, optional
1104 If given, the resulting array must be if the form
1105 ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of
1106 the window. If None is given then the class window is used. The
1107 default is None.
1108 symbol : str, optional
1109 Symbol representing the independent variable. Default is 'x'.
1110
1111 Returns
1112 -------
1113 new_series : series
1114 Series of representing the identity.
1115
1116 """
1117 if domain is None:
1118 domain = cls.domain
1119 if window is None:
1120 window = cls.window
1121 off, scl = pu.mapparms(window, domain)
1122 coef = cls._line(off, scl)
1123 return cls(coef, domain, window, symbol)
1124
1125 @classmethod
1126 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