title: Count of value occurrence in two columns stimulatenously, python
body: <p>Good day,</p>
  
  <p>I have a question, a very basic question. Let's say I have a dataset with user ratings of a movie in rows and movies in columns. I need to find the movies that occur with the movie2. For example, for the movie1, the percentage of the movie2 raters who also rated the movie1 is 0.5 - the number of people who saw both, the movie1 and movie2 is 1 divided by the total number of people seeing and rating the movie2.</p>
  
  <p>Dataset:</p>
  
  <pre><code>import numpy as np
  df = np.array([['','Movie1','Movie2','Movie3'],
                  ['User1',1,0,2],
                  ['User2',2,4,4],
                  ['User3',4,0,4],
                  ['User4',0,2,4]])
  print(pd.DataFrame(data=df[1:,1:],
                    index=df[1:,0],
                    columns=df[0,1:]))
  </code></pre>
  
  <p>The line below finds the number of users who rated a movie. My question is how to add one more condition which also checks whether a corresponding cell in the col movie2 is not 0 - 0 indicates that a person has not seen the movie, it was marked as the missing value in the original dataset:</p>
  
  <pre><code>df.apply(lambda x: x[x!=0]).count(axis=0)
  </code></pre>