fatf.transparency.data.describe_functions.describe_array

fatf.transparency.data.describe_functions.describe_array(array: numpy.ndarray, include: Union[str, int, List[Union[str, int]], None] = None, exclude: Union[str, int, List[Union[str, int]], None] = None, **kwargs) → Dict[Union[str, int], Union[str, int, float, numpy.ndarray, Dict[str, Union[str, int, float, numpy.ndarray]]]][source]

Describes categorical (textual) and numerical columns in the input array.

The details of numerical and categorical descriptions can be found in fatf.transparency.data.describe_functions.describe_numerical_array and fatf.transparency.data.describe_functions.describe_categorical_array functions documentation respectively.

To filter out the columns that will be described you can use include and exclude parameters. Either of these can be a list with columns indices, a string or an integer when excluding or including just one column; or one of the keywords: 'numerical' or 'categorical', to indicate that only numerical or categorical columns should be included/ excluded. By default all columns are described.

Parameters
arraynumpy.ndarray

The array to be described.

includeUnion[str, int, List[Union[str, int]]], optional (default=None)

A list of column indices to be included in the description. If None (the default value), all of the columns will be included. Alternatively this can be set to a single index (either a string or an integer) to compute statistics just for this one column. It is also possible to set it to 'numerical' or 'categorical' to just include numerical or categorical columns respectively.

excludeUnion[str, int, List[Union[str, int]]], optional (default=None)

A list of column indices to be excluded from the description. If None (the default value), none of the columns will be excluded. Alternatively this can be set to a single index (either a string or an integer) to exclude just one column. It is also possible to set it to 'numerical' or 'categorical' to exclude wither all numerical or all categorical columns respectively.

**kwargsbool

Keyword arguments that are passed to the fatf.transparency.data.describe_functions.describe_numerical_array function responsible for describing numerical arrays.

Returns
descriptionDict[Union[str, int], Dict[str, Union[str, int, float bool, np.ndarray]]]

For 2-dimensional arrays a dictionary describing every column under a key corresponding to its index in the input array. For a 1-dimensional input array a dictionary describing that array.

Raises
IncorrectShapeError

The input array is neither 1- not 2-dimensional.

RuntimeError

None of the columns were selected to be described.

ValueError

The input array is not of a base type (textual and numerical elements). The input array has 0 columns.

Warns
UserWarning

When using include or exclude parameters for 1-dimensional input arrays (in which case these parameters are ignored).

Examples using fatf.transparency.data.describe_functions.describe_array