title: only outer join python pandas
body: <p>I have two DataFrames that have the same column names with some matching data and some unique data.</p>
  
  <p>I want to exclude the middle and only save what is unique to both DataFrames.</p>
  
  <p>How would I concat or merge or join these two dataframes to do so?</p>
  
  <p>For instance in this image I do not want the middle in this image, I want both sides but not the middle:</p>
  
  <p><a href="https://i.stack.imgur.com/C0uu9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/C0uu9.png" alt="enter image description here"></a></p>
  
  <p>Here's my code right now:</p>
  
  <pre><code>def query_to_df(query):
      ...
      df_a = pd.DataFrame(data_a)
      df_b = pd.DataFrame(data_b)
      outer_results = pd.concat([df_a, df_b], axis=1, join='outer')
      return df
  </code></pre>
  
  <p>Let me give you an example of what I need:</p>
  
  <pre><code>df_a = 
  col_a  col_b  col_c
     a1     b1     c1
     a2     b2     c2
  
  df_b = 
  col_a  col_b  col_c
     a2     b2     c2
     a3     b3     c3
  
  # they only share the 2nd row:    a2     b2     c2 
  # so the outer result should be:
  col_a  col_b  col_c  col_a  col_b  col_c
     a1     b1     c1     NA     NA     NA
     NA     NA     NA     a3     b3     c3
  </code></pre>
  
  <p>or I'd be just as happy with 2 dataframes</p>
  
  <pre><code>result_1 =
  col_a  col_b  col_c
     a1     b1     c1
  
  result_2 =
  col_a  col_b  col_c
     a3     b3     c3
  </code></pre>
  
  <p>Lastly, you'll notice that <code>a2     b2     c2</code>  were excluded because all of the columns match - how do I specify that I want to join based on all the columns, not just 1? If <code>df_a</code> had had <code>a2     foo     c2</code> I would have wanted that row to be in <code>result_1</code> as well. </p>