Convert an array to a (possibly flattened) array of ints.
Cast all values to ints and possibly flatten [n, 1] arrays to [n]. This method is typically used to sanitize labels before use with analysis tools or metrics that expect 1D arrays as inputs.
ndarray) – An array to possibly flatten and possibly cast to int
bool) – If True, flatten array into a 1D array
The converted array
- Return type
ValueError – Provided input could not be converted to an np.ndarray