Q:

How to find from which row and column the value belong? 

Suppose I created the below data frame
data = {'Height_1': [4.3,6.7,5.4,6.2], 
        'Height_2': [5.1, 6.9, 5.1, 5.2], 
        'Height_3': [4.9,6.2,6.5,6.4]}

df = pd. DataFrame(data) 

Suppose someone comes and asks me 

Find the row and column of height 6.9 ? 
Find in how many rows and columns height 6.2 is present ? 

Please help me with what will be the code for this? 

A:

Using boolean indexing, we can try something like
>>> df[df == 6.9]

Height_1  Height_2  Height_3
0       NaN       NaN       NaN
1       NaN       6.9       NaN
2       NaN       NaN       NaN
3       NaN       NaN       NaN

However, this won't necessarily give you the exact rows and column indices of the data you're looking for.  If you want to get the rows and columns explicitly, we need to do some more work.  
>>> bool_df = df[df == 6.9]
>>> list(bool_df.stack().index)

[(1, 'Height_2')]

As for the second question, we can use the count function, combined with the boolean approach we used earlier. 
>>> df[df == 6.2].count()

Height_1    1
Height_2    0
Height_3    1
dtype: int64

To count the rows, we can use the axis argument. 
>>> df[df == 6.2].count(axis=1)

0    0
1    1
2    0
3    1
dtype: int64

To obtain the simple total count of occurrences of a certain value, we can use NumPy's sum function. 
>>> np.sum(df[df == 6.2].count())

2

