Very similar to "https://stackoverflow.com/questions/60566053/how-to-multiply-dataframe-rows-by-an-array-based-on-an-attribute-of-the-row" but if the original dataframe has index'ed rows not matching array's attribute, df elements return NaNs. Effectively I would like a "left-join" variant implementation
Operand DataFrame df example (dates as index with columns A, B and C):
A B C
2000-01-02 1 2 3
2000-01-03 1 2 3
2000-01-04 1 2 3
2000-01-05 1 2 3
df2:
A B C
2000-01-03 1 2 3
2000-01-04 1 2 3
Trying to get elementwise df*df2 multiplication dataframe result:
A B C
2000-01-02 1 2 3
2000-01-03 1 4 9
2000-01-04 1 4 9
2000-01-05 1 2 3
but instead get
A B C
2000-01-02 NaN NaN NaN
2000-01-03 1 4 9
2000-01-04 1 4 9
2000-01-05 NaN NaN NaN
using solution based on URL reponse, h/t jezrael df_result = (df.mul(df2, level=0))
with addition of fill_value= to no avail in .mul() as parameter
Would anyone have any suggestions ? Thanks in advance