How to remove the pandas framework from another data frame, as well as subtraction:
a=[1,2,3,4,5] b=[1,5] ab=[2,3,4]
And now we have two pandas frames, how to remove df2 from df1:
In [5]: df1=pd.DataFrame([[1,2],[3,4],[5,6]],columns=['a','b']) In [6]: df1 Out[6]: ab 0 1 2 1 3 4 2 5 6 In [9]: df2=pd.DataFrame([[1,2],[5,6]],columns=['a','b']) In [10]: df2 Out[10]: ab 0 1 2 1 5 6
Then we expect the result of df1-df2 to be:
In [14]: df Out[14]: ab 0 3 4
How to do it?
Thanks.
source share