Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas compare two columns of different dataframe

df1['priceDiff?'] = np.where(df1['Price1'] == df2['Price2'], 0, df1['Price1'] - df2['Price2'])
Source by datatofish.com #
 
PREVIOUS NEXT
Tagged: #pandas #compare #columns #dataframe
ADD COMMENT
Topic
Name
7+5 =