numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersRaisesReturnsBackRef
as_series(alist, trim=True)

The returned list contains array(s) of dtype double, complex double, or object. A 1-d argument of shape (N,) is parsed into N arrays of size one; a 2-d argument of shape (M,N) is parsed into M arrays of size N (i.e., is "parsed by row"); and a higher dimensional array raises a Value Error if it is not first reshaped into either a 1-d or 2-d array.

Parameters

alist : array_like

A 1- or 2-d array_like

trim : boolean, optional

When True, trailing zeros are removed from the inputs. When False, the inputs are passed through intact.

Raises

ValueError

Raised when as_series cannot convert its input to 1-d arrays, or at least one of the resulting arrays is empty.

Returns

[a1, a2,...] : list of 1-D arrays

A copy of the input data as a list of 1-d arrays.

Return argument as a list of 1-d arrays.

Examples

>>> from numpy.polynomial import polyutils as pu
... a = np.arange(4)
... pu.as_series(a) [array([0.]), array([1.]), array([2.]), array([3.])]
>>> b = np.arange(6).reshape((2,3))
... pu.as_series(b) [array([0., 1., 2.]), array([3., 4., 5.])]
>>> pu.as_series((1, np.arange(3), np.arange(2, dtype=np.float16)))
[array([1.]), array([0., 1., 2.]), array([0., 1.])]
>>> pu.as_series([2, [1.1, 0.]])
[array([2.]), array([1.1])]
>>> pu.as_series([2, [1.1, 0.]], trim=False)
[array([2.]), array([1.1, 0. ])]
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.polynomial.polyutils.as_series

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/polynomial/polyutils.py#80
type: <class 'function'>
Commit: