Package: a-pandas-ex-set
Finds intersections / differences between pandas DataFrames$pipinstalla-pandas-ex-setimportnumpyasnpimportpandasaspdfroma_pandas_ex_setimportSetdfdf=pd.read_csv("https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv")df2=pd.concat([df,df],ignore_index=True)df2=df2.sample(len(df2))df3,df4,df5=np.split(df2,3)setd=Setdf(df3,df4,df5)columns=['Cabin','Embarked','Sex','Survived']didis2=setd.get_difference_of_all(columns=columns)didis3=setd.get_intersection_of_all(columns=columns)didis4=setd.get_symmetric_difference_and(columns=columns)print(didis2)print(didis3)print(didis4){0:PassengerIdSurvivedPclass...FareCabinEmbarked163174111...30.0000D45S141152111...93.5000B73S116427401...29.7000C118C48748801...29.7000B37C24824911...52.5542D35S161572511...53.1000E8S31831911...164.8667C7S33733811...134.5000E40C175386311...25.9292D17S164275213...12.4750E121S153664611...76.7292D33C44945011...30.5000C104S174085011...89.1042C92C167078011...211.3375B3S57157211...51.4792C101S168079001...79.2000B82B84C146257211...51.4792C101S313211...146.5208B78C110021011...31.0000A31C134045011...30.5000C104S20921011...31.0000A31C9435311...76.7292D33C75175213...12.4750E121S55855911...79.6500E67S67167201...52.0000B71S72472511...53.1000E8S52052111...93.5000B73S84985011...89.1042C92C86786801...50.4958A24S156267201...52.0000B71S77978011...211.3375B3S122833811...134.5000E40C64564611...76.7292D33C168779711...25.9292D17S86286311...25.9292D17S9223211...146.5208B78C120931911...164.8667C7S119630611...151.5500C22C26S175886801...50.4958A24S27327401...29.7000C118C113924911...52.5542D35S79679711...25.9292D17S74074111...30.0000D45S78979001...79.2000B82B84C525311...76.7292D33C137848801...29.7000B37C77277302...10.5000E77S30530611...151.5500C22C26S144955911...79.6500E67S166377302...10.5000E77S[50rowsx12columns],1:PassengerIdSurvivedPclass...FareCabinEmbarked212212...13.0000D56S58358401...40.1250A10C44544611...81.8583A34S24524601...90.0000C78Q147658611...79.6500E68S54054111...71.0000B22S36636711...75.2500D37C113624601...90.0000C78Q87988011...83.1583C50C46246301...38.5000E63S143154111...71.0000B22S27527611...77.9583D7S87187211...52.5542D35S177088011...83.1583C50C157068011...512.3292B51B53B55C118929911...30.5000C106S9122212...13.0000D56S176287211...52.5542D35S159070003...7.6500FG63S136647601...52.0000A14S125736711...75.2500D37C126837801...211.5000C82C70070111...227.5250C62C64C147458401...40.1250A10C58558611...79.6500E68S116627611...77.9583D7S69970003...7.6500FG63S67968011...512.3292B51B53B55C63063111...30.0000A23S135346301...38.5000E63S45745811...51.8625D21S152163111...30.0000A23S47547601...52.0000A14S133644611...81.8583A34S29829911...30.5000C106S134845811...51.8625D21S37737801...211.5000C82C54454501...106.4250C86C28428501...26.0000A19S143554501...106.4250C86C159170111...227.5250C62C64C117528501...26.0000A19S[42rowsx12columns],2:PassengerIdSurvivedPclass...FareCabinEmbarked87287301...5.0000B51B53B55S71271311...52.0000C126S61861912...39.0000F4S106117101...33.5000B19S52752801...221.7792C95S163974901...53.1000D30S150961912...39.0000F4S141852801...221.7792C95S33934001...35.5000TS64764811...35.5000A26C153864811...35.5000A26C176387301...5.0000B51B53B55S111522511...90.0000C93S160371311...52.0000C126S545501...61.9792B30C123034001...35.5000TS74874901...53.1000D30S17017101...33.5000B19S22422511...90.0000C93S11811901...247.5208B58B60C3411...53.1000C123S9455501...61.9792B30C894411...53.1000C123S100911901...247.5208B58B60C[24rowsx12columns]}{0:PassengerIdSurvivedPclass...FareCabinEmbarked154665602...73.5000NaNS121732703...6.2375NaNS66466513...7.9250NaNS75475512...65.0000NaNS72772813...7.7375NaNQ.....................152763703...7.9250NaNS81481503...8.0500NaNS69369403...7.2250NaNC262703...7.2250NaNC49449503...8.0500NaNS[459rowsx12columns],1:PassengerIdSurvivedPclass...FareCabinEmbarked148259211...78.2667D20C55255303...7.8292NaNQ9687803...8.0500NaNS120531502...26.2500NaNS173484403...6.4375NaNC.....................56856903...7.2292NaNC50350403...9.5875NaNS154465413...7.8292NaNQ58959003...8.0500NaNS119130113...7.7500NaNQ[471rowsx12columns],2:PassengerIdSurvivedPclass...FareCabinEmbarked159670602...26.0000NaNS79279303...69.5500NaNS48148202...0.0000NaNS50850903...22.5250NaNS14915002...13.0000NaNS.....................77777813...12.4750NaNS11511603...7.9250NaNS16917003...56.4958NaNS116227213...0.0000NaNS9637302...73.5000NaNS[490rowsx12columns]}{0:PassengerIdSurvivedPclass...FareCabinEmbarked154665602...73.5000NaNS121732703...6.2375NaNS66466513...7.9250NaNS75475512...65.0000NaNS72772813...7.7375NaNQ.....................81481503...8.0500NaNS166377302...10.5000E77S69369403...7.2250NaNC262703...7.2250NaNC49449503...8.0500NaNS[509rowsx12columns],1:PassengerIdSurvivedPclass...FareCabinEmbarked148259211...78.2667D20C55255303...7.8292NaNQ9687803...8.0500NaNS120531502...26.2500NaNS173484403...6.4375NaNC.....................56856903...7.2292NaNC50350403...9.5875NaNS154465413...7.8292NaNQ58959003...8.0500NaNS119130113...7.7500NaNQ[513rowsx12columns],2:PassengerIdSurvivedPclass...FareCabinEmbarked87287301...5.0000B51B53B55S71271311...52.0000C126S159670602...26.0000NaNS79279303...69.5500NaNS48148202...0.0000NaNS.....................11511603...7.9250NaNS100911901...247.5208B58B60C16917003...56.4958NaNS116227213...0.0000NaNS9637302...73.5000NaNS[514rowsx12columns]}