I have a dataset that has mostly numeric columns and I want to extract the position of a particular cell using some condition or criteria i.e., I want that cell’s row and column number. For example, if I have the following dataset:
Hey @mubashir_rizvi, try using this “np.where()” method. The np.where() is a NumPy function that returns the indices of elements in an array that satisfy a given condition. When a single argument is provided, it returns the indices where the given condition is True. In this technique, np.where() is used to get indices (row and column number) of value 6.
Note: The indices would appear as one less than the sequential count of indexes, this is because the index starts from position 0 in Python.