Categories
Mastering Development

Create column based on the comparative match between two dataframes

I have a dataframe A which has a column called A[‘Income’] and another dataframe B which has columns – B[‘Income’] and B[‘category’]. I need to compare A[‘Income’] with B[‘Income’] and create A[‘category’] such that, when A[‘Income’] <= B[‘Income’] then A[‘category’] takes corresponding value of B[‘category’]. and if A[‘Income’] > 1000 then A[‘category’] = 0.1 A: […]