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')
| 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'): |