title: Selecting columns from two dataframes according to another column
body: <p>I have 2 dataframes, one of them contains some general information about football players, and second of them contains other information like winning matches for each player. They both have the "id" column. However, they are not in same length.</p>
  
  <p>What I want to do is creating a new dataframe which contains 2 columns: "x" from first dataframe and "y" from second dataframe, ONLY where the "id" column contains the same value in both dataframes. Thus, I can match the "x" and "y" columns which belong to same person.</p>
  
  <p>I tried to do it using concat function:</p>
  
  <pre><code>pd.concat([firstdataframe['x'], seconddataframe['y']], axis=1, keys=['x', 'y'])
  </code></pre>
  
  <p>But I didn't manage to know how to apply the condition of the "id" being equal in both dataframes.</p>