I have two tables and I would like to append them so that only all the data in table A is retained and data from table B is only added if its key is unique (Key values are u
Easiest answer imaginable:
tableB = pd.concat([tableB, pd.Series(1)], axis=1) mergedTable = tableA.merge(tableB, how="left" on="key") answer = mergedTable[mergedTable.iloc[:,-1].isnull()][tableA.columns.tolist()]
Should be the fastest proposed as well.