fatf.transparency.data.describe_functions.describe_categorical_array¶
- 
fatf.transparency.data.describe_functions.describe_categorical_array(array: Union[numpy.ndarray, numpy.void]) → Dict[str, Union[str, int, bool, numpy.ndarray]][source]¶ Describes a categorical numpy array with basic statistics.
The description output by this function is a dictionary with the following keys:
countintegerThe number of elements in the array.
uniquenumpy.ndarrayThe unique values in the array, ordered lexicographically.
unique_countsnumpy.ndarrayThe counts of the unique values in the array.
topstringThe most frequent value in the array.
freqintegerThe count of the most frequent value in the array.
is_top_uniquebooleanIndicates whether the most frequent value (
freq) in the array is the only one with that count.
- Parameters
 - arrayUnion[numpy.ndarray, numpy.void]
 An array for which a description is desired.
- Returns
 - categorical_descriptionDict[string, Union[string, integer, boolean, numpy.ndarray]]
 A dictionary describing the categorical input array.
- Raises
 - IncorrectShapeError
 The input array is not 1-dimensinoal.
- ValueError
 The input array is empty.
- Warns
 - UserWarning
 When the input array is not purely textual it needs to be converted to a string type before it can be described.