fatf.utils.array.tools.indices_by_type

fatf.utils.array.tools.indices_by_type(array: numpy.ndarray) → Tuple[numpy.ndarray, numpy.ndarray][source]

Identifies indices of columns with numerical and non-numerical values.

Checks whether a numpy array is purely numerical or a structured array and returns two numpy arrays: the first-one with indices of numerical columns and the second-one with indices of non-numerical columns.

Parameters
arraynumpy.ndarray

A numpy array to be checked (it has to be a 2-dimensional array).

Returns
numerical_indicesnumpy.ndarray

A numpy array containing indices of the numerical columns of the input array.

non_numerical_indicesnumpy.ndarray

A numpy array containing indices of the non-numerical columns of the input array.

Raises
TypeError

The input array is not a numpy array-like object.

ValueError

The input array consists of complex types such as numpy void and object-like types that are not supported by this function.

IncorrectShapeError

The input array is not 2-dimensional.