BPt.util.is_array_like#

BPt.util.is_array_like(in_val)[source]#

Helper function to check if a value is array like or not.

Parameters
in_valanything

The input to check if array like.

Returns
is_array_likebool

True if array like, False if not.

Examples

In [1]: from BPt.util import is_array_like

In [2]: import numpy as np

In [3]: is_array_like([1, 2, 3])
Out[3]: True

In [4]: is_array_like('some_string')
Out[4]: False

In [5]: is_array_like(5)
Out[5]: False

In [6]: is_array_like(set([1, 2, 3]))
Out[6]: True

In [7]: is_array_like(np.array([1, 2, 3]))
Out[7]: True