SHARE
TWEET

Untitled

a guest Jul 19th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pandas as pd
  2.  
  3. df1 = pd.DataFrame({ 'colA': [10, 20, 30],
  4.                      'colB': [100, 200, 300]})
  5.  
  6. df2 = pd.DataFrame({ 'colA': [40, 20, 50],
  7.                      'colB': [400, 200, 500]})
  8.    
  9. new_df = pd.concat([df1, df2]).drop_duplicates().reset_index(drop=True)
  10. print(new_df)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top