Horje
remove common rows in two dataframes pandas Code Example
remove common rows in two dataframes pandas
In [1]: import pandas as pd
df_1 = pd.DataFrame({"A":["foo", "foo", "foo", "bar"], "B":[0,1,1,1], "C":["A","A","B","A"]})
df_2 = pd.DataFrame({"A":["foo", "bar", "foo", "bar"], "B":[1,0,1,0], "C":["A","B","A","B"]})

In [2]: df = pd.concat([df_1, df_2])

In [3]: df
Out[3]: 
     A  B  C
0  foo  0  A
1  foo  1  A
2  foo  1  B
3  bar  1  A
0  foo  1  A
1  bar  0  B
2  foo  1  A
3  bar  0  B

In [4]: df.drop_duplicates(keep=False)
Out[4]: 
     A  B  C
0  foo  0  A
2  foo  1  B
3  bar  1  A




Python

Related
python send data to ip address Code Example python send data to ip address Code Example
from pandas to dictionary Code Example from pandas to dictionary Code Example
convert outlook email to text file python Code Example convert outlook email to text file python Code Example
get most recurring element in a list python Code Example get most recurring element in a list python Code Example
opencv houghlines only horizontal Code Example opencv houghlines only horizontal Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8