Finding intersection between two Dataframes and taking mean - Python
<p>I have two DFs. </p>

<p>df1</p>

<pre><code>userID  time_taken  Score
1          65         5
2          25         6
3          78         4
4          45         7
5          98         8
6          65         9
7          24         2
8          21         5
9          35         6
10         79         3
</code></pre>

<p>df2</p>

<pre><code>userID  time_taken  Score
1           78        7
4           54        8
7           23        5
10          96        4
</code></pre>

<p>I want to find the intersection between two DFs based on userID and find the mean for rest of the variables.</p>

<p>My output should be,</p>

<pre><code>userID  time_taken  Score
1          71.5       6
4          49.5      7.5
7          23.5      3.5
10         87.5      3.5
</code></pre>

<p>Can anybody help me in doing this?</p>

<p>Thanks</p>