numpoly.expand_dims

numpoly.expand_dims(a: numpoly.typing.PolyLike, axis: int)numpoly.baseclass.ndpoly[source]

Expand the shape of an array.

Insert a new axis that will appear at the axis position in the expanded array shape.

Args:
a:

Input array.

axis:

Position in the expanded axes where the new axis is placed.

Return:

View of a with the number of dimensions increased by one.

Example:
>>> poly = numpoly.variable(2)
>>> numpoly.expand_dims(poly, axis=0)
polynomial([[q0, q1]])
>>> numpoly.expand_dims(poly, axis=1)
polynomial([[q0],
            [q1]])