I have the following 2 dataframes.
My first DF is this one, I such a DDBB, where I have only one occurrence from each ISIN value.
ISIN inst inst_type type
asd 1 2 ETF
asb 2 b Bond
bcd 3 c Bond
My second DF is the following one,
ISIN inst inst_type type
asd 1 2 ""
asd 1 2 ""
bcd 3 c ""
bcd 3 c ""
bcd 3 c ""
asb 2 b ""
What I want to do is to fill second dataframe 'type' column base on the first DF , for example. In my first DF for ISIN 'asd' type is 'ETF' so my second ETF should be like this.
ISIN inst inst_type type
asd 1 2 ETF
asd 1 2 ETF
bcd 3 c ""
bcd 3 c ""
bcd 3 c ""
asb 2 b ""
I can do it using for loop but my problem is that if I have a Df with 400k rows it is not a efficient way for doing that.
Any idea how to solve it more efficient?