Transposing Dynamic Columns to Rows
I’d like to know how to unpivot Table_1
into Expected_Result_Table
:
I’d like to know how to unpivot Table_1
into Expected_Result_Table
:
I have two ndarrays of size (m x n), and two lists of length m and n respectively. I want to convert the two matrices to a dataframe with four columns. The first two columns correspond to the m and n dimensions, and contain the values from the lists. The next two columns should contain the values from the two matrices. In total, the resulting dataframe should have m times n rows.