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

Method convert

numpy/polynomial/_polybase.py:787–822  ·  view source on GitHub ↗

Convert series to a different kind and/or domain and/or window. Parameters ---------- domain : array_like, optional The domain of the converted series. If the value is None, the default domain of `kind` is used. kind : class, optional

(self, domain=None, kind=None, window=None)

Source from the content-addressed store, hash-verified

785 return self.__class__(coef, self.domain, self.window, self.symbol)
786
787 def convert(self, domain=None, kind=None, window=None):
788 """Convert series to a different kind and/or domain and/or window.
789
790 Parameters
791 ----------
792 domain : array_like, optional
793 The domain of the converted series. If the value is None,
794 the default domain of `kind` is used.
795 kind : class, optional
796 The polynomial series type class to which the current instance
797 should be converted. If kind is None, then the class of the
798 current instance is used.
799 window : array_like, optional
800 The window of the converted series. If the value is None,
801 the default window of `kind` is used.
802
803 Returns
804 -------
805 new_series : series
806 The returned class can be of different type than the current
807 instance and/or have a different domain and/or different
808 window.
809
810 Notes
811 -----
812 Conversion between domains and class types can result in
813 numerically ill defined series.
814
815 """
816 if kind is None:
817 kind = self.__class__
818 if domain is None:
819 domain = kind.domain
820 if window is None:
821 window = kind.window
822 return self(kind.identity(domain, window=window, symbol=self.symbol))
823
824 def mapparms(self):
825 """Return the mapping parameters.

Callers 3

castMethod · 0.80
test_conversionFunction · 0.80
test_convertMethod · 0.80

Calls 1

identityMethod · 0.80

Tested by 2

test_conversionFunction · 0.64
test_convertMethod · 0.64