dask 2021.10.0

BackRef
is_arraylike(x)

This function tests specifically for an object that already has array attributes (e.g. np.ndarray, dask.array.Array, cupy.ndarray, sparse.COO), NOT for something that can be coerced into an array object (e.g. Python lists and tuples). It is meant for dask developers and developers of downstream libraries.

Note that this function does not correspond with NumPy's definition of array_like, which includes any object that can be coerced into an array (see definition in the NumPy glossary): https://numpy.org/doc/stable/glossary.html

Is this object a numpy array or something similar?

Examples

This example is valid syntax, but we were not able to check execution
>>> import numpy as np
... is_arraylike(np.ones(5)) True
This example is valid syntax, but we were not able to check execution
>>> is_arraylike(np.ones(()))
True
This example is valid syntax, but we were not able to check execution
>>> is_arraylike(5)
False
This example is valid syntax, but we were not able to check execution
>>> is_arraylike('cat')
False
See :

Back References

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

dask.utils.is_arraylike

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


File: /dask/utils.py#1225
type: <class 'function'>
Commit: