How to get the symmetric difference of pandas DataFrames in Python

Getting the symmetric difference of pandas.DataFrames results in a new DataFrame containing only rows which occur only once in all the DataFrames.

Solution for How to get the symmetric difference of pandas DataFrames in Python : You can use pandas.concat() and pandas.DataFrame.drop_duplicates() to get the symmetric difference of DataFrames Call pandas.concat(list_of_dataframes) to combine all the DataFrames in list_of_dataframes into one DataFrame. Call pandas.DataFrame.drop_duplicates(keep=False) to remove any duplicate rows from the previous result pandas.Dataframe.


how-to-get-the-symmetric-difference-of-pandas-dataframes-in-python