numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
fromiter(iter, dtype, count=-1, *, like=None)

Notes

Specify :None:None:`count` to improve performance. It allows fromiter to pre-allocate the output array, instead of resizing it on demand.

Parameters

iter : iterable object

An iterable object providing data for the array.

dtype : data-type

The data-type of the returned array.

count : int, optional

The number of items to read from iterable. The default is -1, which means all data is read.

like : array_like

Reference object to allow the creation of arrays which are not NumPy arrays. If an array-like passed in as like supports the __array_function__ protocol, the result will be defined by it. In this case, it ensures the creation of an array object compatible with that passed in via this argument.

versionadded

Returns

out : ndarray

The output array.

Create a new 1-dimensional array from an iterable object.

Examples

>>> iterable = (x*x for x in range(5))
... np.fromiter(iterable, float) array([ 0., 1., 4., 9., 16.])
See :

Back References

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

numpy.asanyarray numpy.asarray_chkfinite numpy.fromstring numpy.asarray

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 : None#None
type: <class 'builtin_function_or_method'>
Commit: