I have two dataframes, where the first dataframe indexes/columns relate to the second dataframe indexes/columns. In df1, the columns are the months of df2, and the rows are the low layer of the indexes. I want to distribute df1 in df2 based on that relation. Here is a simplified example:
df1 = pd.DataFrame([[1, 2], [3, 4]], index= [1,2], columns=[1, 6])
index_list = [[1, 1, 2, 2],[1,2,1,2]]
header_list = [np.datetime64('2020-01-01'), np.datetime64('2020-06-01'),np.datetime64('2021-01-01'),np.datetime64('2021-06-01')]
df2 = pd.DataFrame(index=index_list, columns=header_list)