Created
July 8, 2019 15:06
-
-
Save DataSolveProblems/962a4cd585dac0cd484b593510435ad2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
df1 = pd.DataFrame({ 'colA': [10, 20, 30], | |
'colB': [100, 200, 300]}) | |
df2 = pd.DataFrame({ 'colA': [40, 20, 50], | |
'colB': [400, 200, 500]}) | |
new_df = pd.concat([df1, df2]).drop_duplicates().reset_index(drop=True) | |
print(new_df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment