chaospy.aspolynomial¶
- chaospy.aspolynomial(poly_like: Union[numpy._typing._array_like._SupportsArray[numpy.dtype], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]], numpoly.baseclass.ndpoly], names: Union[None, str, Tuple[str, ...], numpoly.baseclass.ndpoly] = None, dtype: Union[numpy.dtype[Any], None, Type[Any], numpy._typing._dtype_like._SupportsDType[numpy.dtype[Any]], str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], numpy._typing._dtype_like._DTypeDict, Tuple[Any, Any]] = None) numpoly.baseclass.ndpoly [source]¶
Convert the input to an polynomial array.
- Args:
- poly_like:
Input to be converted to a numpoly.ndpoly polynomial type.
- names:
Name of the indeterminant variables. If possible to infer from
poly_like
, this argument will be ignored.- dtype:
Data type used for the polynomial coefficients.
- Return:
Array interpretation of poly_like. No copy is performed if the input is already an ndpoly with matching indeterminants names and dtype.
- Example:
>>> q0 = numpoly.variable() >>> numpoly.polynomial(q0) is q0 False >>> numpoly.aspolynomial(q0) is q0 True