In a multidimensional NumPy array, the numpy.where() function returns a tuple containing the indices of the elements that satisfy the condition. Each element of the tuple corresponds to a dimension of the array.

Here's an example to illustrate how to find the indices of a value in a 2D NumPy array:

import numpy as np

# Create a 2D numpy array
array_2d = np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8]])

# Get the indices of value 4
indices = np.where(array_2d == 4)

# Print the indices
print("Value 4 exists at indices: ", list(zip(indices[0], indices[1])))
This will output:

Value 4 exists at indices: [(1, 1)]
In this example, the value 4 exists at the index (1, 1) in the 2D array. The first element of the tuple represents the row indices, and the second element represents the column indices.

You can extend this approach to arrays with more dimensions as well. The numpy.where() function will return as many arrays in the tuple as there are dimensions in the original array.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence