I would like to fill in null values of one pandas dataframe with another dataframe (and multiple times, with multiple dataframes).
Example:
df_A
A B C
index
0 3 5.00 8.00
1 8 25.00 NaN
2 1 NaN 111.00
df_B
A B C
index
0 NaN 8.00 13.00
1 1.00 NaN NaN
2 8.00 8.00 8.00
Resulting dataframe:
A B C
index
0 3 5.00 8.00
1 8 25.00 NaN
2 1 8.00 111.00 # <= 8.00 was filled in here
TL;DR
My actual use case is that I query meteostat for weather data, and you can query different weather stations, where you are given each weather station's distance to your target location... and different weather stations often have different pockets of empty data.
But also, I would like to know how to do this because I am sure I have wanted this in the past for other reasons.
Thank you!
I am having to loop through each row (and column) right now to accomplish this, but I am certain there is a better way!
I have seen this similar question asked, but there is always only one column... must I iterate through column-wise?