numpoly.variable

numpoly.variable(dimensions: int = 1, asarray: bool = False, 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]] = 'i8', allocation: Optional[int] = None)numpoly.baseclass.ndpoly[source]

Construct variables that can be used to construct polynomials.

Args:
dimensions:

Number of dimensions in the array.

asarray:

Enforce output as array even in the case where there is only one variable.

dtype:

The data type of the polynomial coefficients.

allocation:

The maximum number of polynomial exponents. If omitted, use length of exponents for allocation.

Return:

Polynomial array with unit components in each dimension.

Example:
>>> numpoly.variable()
polynomial(q0)
>>> q0, q1, q2 = numpoly.variable(3)
>>> q1+1
polynomial(q1+1)
>>> numpoly.polynomial([q2**3, q1+q2, 1])
polynomial([q2**3, q2+q1, 1])