I have a question regarding merging dataframes.
I have created a dataframe with three empty columns, named USD, EUR, GBP.
group USD EUR GBP0 A None None None1 B None None None2 C None None NoneI now would like to fill in values for these columns, based on the USD, EUR, GBP values that I have saved in another dataframe, for example:
group USD EUR GBP0 A NaN 0.05 0.041 B 0.04 NaN 0.032 C 0.02 NaN 0.01Why am I not just merging based on 'group' ? Because the value dataframe would not always show three columns but two columns instead, for example:
group USD EUR0 A NaN 0.051 B 0.04 NaN2 C 0.02 NaNThe issue here is that I would like to see all three columns in the final output, regardless of whether data of a particular column exists or not. So the final output, using the third table as 'data table' should look like this:
group USD EUR GBP0 A NaN 0.05 NaN1 B 0.04 NaN NaN2 C 0.02 NaN NaNDo you have any ideas on how to tackle this? Any help would be much appreciated