Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement