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 toTrue
, anynumpy.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 tonumpy.nan
.The description output by this function is a dictionary with the following keys:
count
integerThe number of elements in the array.
mean
floatThe mean (average) value of the array.
std
floatThe standard deviation of the array.
min
floatThe minimum value in the array.
25%
floatThe 25 percentile of the array.
50%
floatThe 50 percentile of the array, which is equivalent to its median.
75%
floatThe 75 percentile of the array.
max
floatThe maximum value in the array.
nan_count
integerThe 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.nan
s 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.