fatf.transparency.data.describe_functions.describe_numerical_array

fatf.transparency.data.describe_functions.describe_numerical_array(array: Union[numpy.ndarray, numpy.void], skip_nans: bool = True) → Dict[str, Union[int, float, numpy.ndarray]][source]

Describes a numerical numpy array with basic statistics.

If the skip_nans parameter is set to True, any numpy.nan present in the input array is skipped for calculating the statistics. Otherwise, they are included, affecting most of the statistics and possibly equating them to numpy.nan.

The description output by this function is a dictionary with the following keys:

countinteger

The number of elements in the array.

meanfloat

The mean (average) value of the array.

stdfloat

The standard deviation of the array.

minfloat

The minimum value in the array.

25%float

The 25 percentile of the array.

50%float

The 50 percentile of the array, which is equivalent to its median.

75%float

The 75 percentile of the array.

maxfloat

The maximum value in the array.

nan_countinteger

The count of numpy.nan (not-a-number) values in the array.

Parameters
arrayUnion[numpy.ndarray, numpy.void]

An array for which a description is desired.

skip_nansboolean, optional (default=True)

If set to True, numpy.nans present in the input array will be excluded while computing the statistics.

Returns
numerical_descriptionDict[string, Union[integer, float, numpy.ndarray]]

A dictionary describing the numerical input array.

Raises
IncorrectShapeError

The input array is not 1-dimensional.

ValueError

The input array is not purely numerical or it is empty.