Return indices that are non-zero in the flattened version of a. This is equivalent to a.ravel().nonzero()[0]. Parameters: a : ndarray Input array. Returns: res : ndarray Output array, containing the indices of the elements of a.ravel() that are non-z…